From 376c645e2bb44c10317c3f3b8aca53f16da0975a Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Mon, 8 Nov 2021 10:35:25 +0900 Subject: CSS Box Model のプロパティを更新 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 2021/11/07 時点の英語版に同期 --- files/ja/web/css/margin-bottom/index.md | 148 ++++++++++------------- files/ja/web/css/margin-bottom/margin-bottom.svg | 1 + 2 files changed, 63 insertions(+), 86 deletions(-) create mode 100644 files/ja/web/css/margin-bottom/margin-bottom.svg (limited to 'files/ja/web/css/margin-bottom') diff --git a/files/ja/web/css/margin-bottom/index.md b/files/ja/web/css/margin-bottom/index.md index f035539d6b..ec8b38ea0d 100644 --- a/files/ja/web/css/margin-bottom/index.md +++ b/files/ja/web/css/margin-bottom/index.md @@ -3,26 +3,26 @@ title: margin-bottom slug: Web/CSS/margin-bottom tags: - CSS - - CSS Property - - Reference - - 'recipe:css-property' + - CSS プロパティ + - リファレンス + - recipe:css-property +browser-compat: css.properties.margin-bottom translation_of: Web/CSS/margin-bottom --- -
{{CSSRef}}
+{{CSSRef}} -

margin-bottomCSS のプロパティで、要素の下側のマージン領域を設定します。正の数を指定すると、隣との間が遠くなるように配置され、負の数を指定すると、近くなるように配置します。

+**`margin-bottom`** は [CSS](/ja/docs/Web/CSS) のプロパティで、要素の下側の[マージン領域](/ja/docs/Web/CSS/CSS_Box_Model/Introduction_to_the_CSS_box_model#マージン領域)を設定します。正の数を指定すると、隣との間が遠くなるように配置され、負の数を指定すると、近くなるように配置します。 -
{{EmbedInteractiveExample("pages/css/margin-bottom.html")}}
+{{EmbedInteractiveExample("pages/css/margin-bottom.html")}} - +![要素ボックスにおける CSS の margin-bottom プロパティの効果](margin-bottom.svg) -

要素ボックスにおける CSS の margin-bottom プロパティの効果

+このプロパティは、 {{HTMLElement("span")}} または {{HTMLElement("code")}} のような非[置換](/ja/docs/Web/CSS/Replaced_element)のインライン要素には効果がありません。 -

このプロパティは、 {{HTMLElement("span")}} または {{HTMLElement("code")}} のような置換のインライン要素には効果がありません。

+## 構文 -

構文

- -
/* <length> 値 */
+```css
+/*  値 */
 margin-bottom: 10px;  /* 絶対的な寸法 */
 margin-bottom: 1em;   /* 文字の寸法からの相対 */
 margin-bottom: 5%;    /* 直近のブロックコンテナーの幅からの相対 */
@@ -33,47 +33,49 @@ margin-bottom: auto;
 /* グローバル値 */
 margin-bottom: inherit;
 margin-bottom: initial;
+margin-bottom: revert;
 margin-bottom: unset;
-
+``` -

margin-bottom プロパティは auto キーワード、または <length><percentage> で指定されます。正の数、ゼロ、負の数が指定できます。

+`margin-bottom` プロパティは `auto` キーワード、または `` や `` で指定されます。正の数、ゼロ、負の数が指定できます。 -

+### 値 -
-
{{cssxref("<length>")}}
-
固定値によるマージンの寸法です。
-
{{cssxref("<percentage>")}}
-
包含ブロックの width に対するパーセントによるマージンの寸法です。
-
auto
-
ブラウザ―が適切な値を選択して使用します。 {{cssxref("margin")}} を参照してください。
-
+- {{cssxref("<length>")}} + - : マージンの寸法を固定値で表したものです。 +- {{cssxref("<percentage>")}} + - : マージンの寸法を包含ブロックの*幅*に対するパーセント値で表したものです。 +- `auto` + - : ブラウザ―が適切な値を選択して使用します。 {{cssxref("margin")}} を参照してください。 -

公式定義

+## 公式定義 -

{{cssinfo}}

+{{cssinfo}} -

形式文法

+## 形式文法 {{csssyntax}} -

+## 例 -

正および負の数の下側のマージンの設定

+

正および負の数の下側のマージンの設定

-

HTML

+#### HTML -
<div class="container">
-<div class="box0">Box 0</div>
-<div class="box1">Box 1</div>
-<div class="box2">Box one's negative margin pulls me up</div>
-</div>
+```html +
+
Box 0
+
Box 1
+
Box one's negative margin pulls me up
+
+``` -

CSS

+#### CSS -

div に margin-bottom と height を設定する CSS です。

+div に margin-bottom と height を設定する CSS です。 -
.box0 {
+```css
+.box0 {
     margin-bottom:1em;
     height:3em;
 }
@@ -86,12 +88,12 @@ margin-bottom: unset;
     border-width:1px 0;
     margin-bottom:2em;
 }
+```
 
-
- -

包含要素と div の定義の一部です。これによって margin の効果がより明確に見えます。

+包含要素と div の定義の一部です。これによってマージンの効果がより明確に見えます。 -
.container {
+```css
+.container {
     background-color:orange;
     width:320px;
     border:1px solid black;
@@ -99,48 +101,22 @@ margin-bottom: unset;
 div {
     width:320px;
     background-color:gold;
-}
- -

結果

- -

{{ EmbedLiveSample('Setting_positive_and_negative_bottom_margins',350,200) }}

- -

仕様書

- - - - - - - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('CSS3 Box', '#propdef-margin-bottom', 'margin-bottom')}}{{Spec2('CSS3 Box')}}目立った変更なし。
{{SpecName('CSS2.1', 'box.html#margin-properties', 'margin-bottom')}}{{Spec2('CSS2.1')}}CSS1 と同様、ただしインライン要素での効果は削除。
{{SpecName('CSS1', '#margin-bottom', 'margin-bottom')}}{{Spec2('CSS1')}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("css.properties.margin-bottom")}}

- -

関連情報

- -
    -
  • {{cssxref("margin-top")}}, {{cssxref("margin-right")}}, {{cssxref("margin-left")}} と {{cssxref("margin")}} 一括指定
  • -
  • 対応する論理プロパティ: {{cssxref("margin-block-start")}}, {{cssxref("margin-block-end")}}, {{cssxref("margin-inline-start")}}, {{cssxref("margin-inline-end")}} および一括指定の {{cssxref("margin-block")}} と {{cssxref("margin-inline")}}
  • -
+} +``` + +#### 結果 + +{{ EmbedLiveSample('Setting_positive_and_negative_bottom_margins',350,200) }} + +## 仕様書 + +{{Specifications}} + +## ブラウザーの互換性 + +{{Compat}} + +## 関連情報 + +- {{cssxref("margin-top")}}, {{cssxref("margin-right")}}, {{cssxref("margin-left")}} と {{cssxref("margin")}} 一括指定 +- 対応する論理的プロパティ: {{cssxref("margin-block-start")}}, {{cssxref("margin-block-end")}}, {{cssxref("margin-inline-start")}}, {{cssxref("margin-inline-end")}} および一括指定の {{cssxref("margin-block")}} と {{cssxref("margin-inline")}} diff --git a/files/ja/web/css/margin-bottom/margin-bottom.svg b/files/ja/web/css/margin-bottom/margin-bottom.svg new file mode 100644 index 0000000000..102a3dc064 --- /dev/null +++ b/files/ja/web/css/margin-bottom/margin-bottom.svg @@ -0,0 +1 @@ +マージン領域境界コンテンツ領域パディング領域この領域の高さが margin-bottom 値で定義されるmargin-bottom \ No newline at end of file -- cgit v1.2.3-54-g00ecf