From b5dcea43eb1d9e42283f42a6edcd52ae3208cf23 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Mon, 8 Nov 2021 00:46:41 +0900 Subject: CSS Box Model のプロパティの変換準備 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/ja/web/css/margin-bottom/index.html | 146 ----------------------- files/ja/web/css/margin-bottom/index.md | 146 +++++++++++++++++++++++ files/ja/web/css/margin-left/index.html | 169 --------------------------- files/ja/web/css/margin-left/index.md | 169 +++++++++++++++++++++++++++ files/ja/web/css/margin-right/index.html | 166 -------------------------- files/ja/web/css/margin-right/index.md | 166 ++++++++++++++++++++++++++ files/ja/web/css/margin-top/index.html | 106 ----------------- files/ja/web/css/margin-top/index.md | 106 +++++++++++++++++ files/ja/web/css/margin-trim/index.md | 108 +++++++++++++++++ files/ja/web/css/margin/index.html | 180 ----------------------------- files/ja/web/css/margin/index.md | 180 +++++++++++++++++++++++++++++ files/ja/web/css/padding-bottom/index.html | 110 ------------------ files/ja/web/css/padding-bottom/index.md | 110 ++++++++++++++++++ files/ja/web/css/padding-left/index.html | 108 ----------------- files/ja/web/css/padding-left/index.md | 108 +++++++++++++++++ files/ja/web/css/padding-right/index.html | 108 ----------------- files/ja/web/css/padding-right/index.md | 108 +++++++++++++++++ files/ja/web/css/padding-top/index.html | 110 ------------------ files/ja/web/css/padding-top/index.md | 110 ++++++++++++++++++ files/ja/web/css/padding/index.html | 167 -------------------------- files/ja/web/css/padding/index.md | 167 ++++++++++++++++++++++++++ 21 files changed, 1478 insertions(+), 1370 deletions(-) delete mode 100644 files/ja/web/css/margin-bottom/index.html create mode 100644 files/ja/web/css/margin-bottom/index.md delete mode 100644 files/ja/web/css/margin-left/index.html create mode 100644 files/ja/web/css/margin-left/index.md delete mode 100644 files/ja/web/css/margin-right/index.html create mode 100644 files/ja/web/css/margin-right/index.md delete mode 100644 files/ja/web/css/margin-top/index.html create mode 100644 files/ja/web/css/margin-top/index.md create mode 100644 files/ja/web/css/margin-trim/index.md delete mode 100644 files/ja/web/css/margin/index.html create mode 100644 files/ja/web/css/margin/index.md delete mode 100644 files/ja/web/css/padding-bottom/index.html create mode 100644 files/ja/web/css/padding-bottom/index.md delete mode 100644 files/ja/web/css/padding-left/index.html create mode 100644 files/ja/web/css/padding-left/index.md delete mode 100644 files/ja/web/css/padding-right/index.html create mode 100644 files/ja/web/css/padding-right/index.md delete mode 100644 files/ja/web/css/padding-top/index.html create mode 100644 files/ja/web/css/padding-top/index.md delete mode 100644 files/ja/web/css/padding/index.html create mode 100644 files/ja/web/css/padding/index.md (limited to 'files/ja') diff --git a/files/ja/web/css/margin-bottom/index.html b/files/ja/web/css/margin-bottom/index.html deleted file mode 100644 index f035539d6b..0000000000 --- a/files/ja/web/css/margin-bottom/index.html +++ /dev/null @@ -1,146 +0,0 @@ ---- -title: margin-bottom -slug: Web/CSS/margin-bottom -tags: - - CSS - - CSS Property - - Reference - - 'recipe:css-property' -translation_of: Web/CSS/margin-bottom ---- -
{{CSSRef}}
- -

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

- -
{{EmbedInteractiveExample("pages/css/margin-bottom.html")}}
- - - -

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

- -

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

- -

構文

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

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

- -

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

公式定義

- -

{{cssinfo}}

- -

形式文法

- -{{csssyntax}} - -

- -

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

- -

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>
- -

CSS

- -

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

- -
.box0 {
-    margin-bottom:1em;
-    height:3em;
-}
-.box1 {
-    margin-bottom:-1.5em;
-    height:4em;
-}
-.box2 {
-    border:1px dashed black;
-    border-width:1px 0;
-    margin-bottom:2em;
-}
-
-
- -

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

- -
.container {
-    background-color:orange;
-    width:320px;
-    border:1px solid black;
-}
-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")}}

- -

関連情報

- - diff --git a/files/ja/web/css/margin-bottom/index.md b/files/ja/web/css/margin-bottom/index.md new file mode 100644 index 0000000000..f035539d6b --- /dev/null +++ b/files/ja/web/css/margin-bottom/index.md @@ -0,0 +1,146 @@ +--- +title: margin-bottom +slug: Web/CSS/margin-bottom +tags: + - CSS + - CSS Property + - Reference + - 'recipe:css-property' +translation_of: Web/CSS/margin-bottom +--- +
{{CSSRef}}
+ +

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

+ +
{{EmbedInteractiveExample("pages/css/margin-bottom.html")}}
+ + + +

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

+ +

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

+ +

構文

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

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

+ +

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

公式定義

+ +

{{cssinfo}}

+ +

形式文法

+ +{{csssyntax}} + +

+ +

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

+ +

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>
+ +

CSS

+ +

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

+ +
.box0 {
+    margin-bottom:1em;
+    height:3em;
+}
+.box1 {
+    margin-bottom:-1.5em;
+    height:4em;
+}
+.box2 {
+    border:1px dashed black;
+    border-width:1px 0;
+    margin-bottom:2em;
+}
+
+
+ +

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

+ +
.container {
+    background-color:orange;
+    width:320px;
+    border:1px solid black;
+}
+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")}}

+ +

関連情報

+ + diff --git a/files/ja/web/css/margin-left/index.html b/files/ja/web/css/margin-left/index.html deleted file mode 100644 index 029fd44321..0000000000 --- a/files/ja/web/css/margin-left/index.html +++ /dev/null @@ -1,169 +0,0 @@ ---- -title: margin-left -slug: Web/CSS/margin-left -tags: - - CSS - - CSS Property - - Layout - - Reference - - 'recipe:css-property' -translation_of: Web/CSS/margin-left ---- -
{{CSSRef}}
- -

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

- -
{{EmbedInteractiveExample("pages/css/margin-left.html")}}
- - - -

二つの隣り合うボックスの垂直マージンは融合することがあります。これはマージンの相殺と呼ばれています。

- -

まれに幅の制約がきつすぎると (つまり、 width, margin-left, border, padding, コンテンツ領域, margin-right がすべて定義されていた場合)、 margin-left は無視され、 auto が設定されていたときと同じ計算値になります。

- -

構文

- -
/* <length> 値 */
-margin-left: 10px;  /* 絶対的な寸法 */
-margin-left: 1em;   /* 文字の寸法からの相対 */
-margin-left: 5%;    /* 直近のブロックコンテナーの幅からの相対 */
-
-/* キーワード値 */
-margin-left: auto;
-
-/* グローバル値 */
-margin-left: inherit;
-margin-left: initial;
-margin-left: unset;
-
- -

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

- -

- -
-
{{cssxref("<length>")}}
-
固定値によるマージンの寸法です。
-
{{cssxref("<percentage>")}}
-
包含ブロックの width に対するパーセントによるマージンの寸法です。
-
auto
-
左マージンは未使用の水平方向の余白を共有します。これは主に使用されているレイアウトモードによって決定されます。 margin-leftmargin-right の両方が auto の場合は、両方に均等に割り当てられます。それ以外の場合は以下の表のとおりです。 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{cssxref("display")}} の値{{cssxref("float")}} の値{{cssxref("position")}} の値auto の計算値コメント
inline, inline-block, inline-table任意static または relative0インラインレイアウトモード
block, inline, inline-block, block, table, inline-table, list-item, table-caption任意static または relative0。ただし margin-leftmargin-right が共に auto に設定されていた場合は、親要素の中で中央揃えする値に設定されます。ブロックレイアウトモード
block, inline, inline-block, block, table, inline-table, list-item, table-captionleft または rightstatic または relative0ブロックレイアウトモード (フロート要素)
table-* すべて、ただし table-caption を除く任意任意0内部の table-* 要素にはマージンがありません。代わりに {{ cssxref("border-spacing") }} を使用してください
flexinline-flex, table-* 以外のすべて任意fixed または absolute0。ただし margin-leftmargin-right が共に auto に設定されていた場合は、ボーダー領域を width の中で中央揃えする値に設定されます(固定されている場合)。絶対位置指定配置モード
flex, inline-flex任意任意0。ただし、水平に正の余白がある場合は、 auto を指定したすべてのマージンに均等に割り振られます。フレックスボックス配置モード
-
-
- -

公式定義

- -

{{cssinfo}}

- -

形式文法

- -{{csssyntax}} - -

- -

ピクセル数とパーセント値を使用した左マージンの設定

- -
.content { margin-left: 5%; }
-.sidebox { margin-left: 10px; }
-.logo    { margin-left: -5px; }
-
- -

仕様書

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('CSS3 Box', '#propdef-margin-left', 'margin-left')}}{{Spec2('CSS3 Box')}}CSS 2.1 から目立った変更なし。
{{SpecName('CSS3 Flexbox', '#item-margins', 'margin-left')}}{{Spec2('CSS3 Flexbox')}}フレックス項目での margin-left の挙動を定義。
{{SpecName('CSS2.1', 'box.html#margin-properties', 'margin-left')}}{{Spec2('CSS2.1')}}CSS1 と同様、ただしインライン要素での効果は削除。
{{SpecName('CSS1', '#margin-left', 'margin-left')}}{{Spec2('CSS1')}}初回定義
- -

ブラウザーの互換性

- -

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

- -

関連情報

- - diff --git a/files/ja/web/css/margin-left/index.md b/files/ja/web/css/margin-left/index.md new file mode 100644 index 0000000000..029fd44321 --- /dev/null +++ b/files/ja/web/css/margin-left/index.md @@ -0,0 +1,169 @@ +--- +title: margin-left +slug: Web/CSS/margin-left +tags: + - CSS + - CSS Property + - Layout + - Reference + - 'recipe:css-property' +translation_of: Web/CSS/margin-left +--- +
{{CSSRef}}
+ +

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

+ +
{{EmbedInteractiveExample("pages/css/margin-left.html")}}
+ + + +

二つの隣り合うボックスの垂直マージンは融合することがあります。これはマージンの相殺と呼ばれています。

+ +

まれに幅の制約がきつすぎると (つまり、 width, margin-left, border, padding, コンテンツ領域, margin-right がすべて定義されていた場合)、 margin-left は無視され、 auto が設定されていたときと同じ計算値になります。

+ +

構文

+ +
/* <length> 値 */
+margin-left: 10px;  /* 絶対的な寸法 */
+margin-left: 1em;   /* 文字の寸法からの相対 */
+margin-left: 5%;    /* 直近のブロックコンテナーの幅からの相対 */
+
+/* キーワード値 */
+margin-left: auto;
+
+/* グローバル値 */
+margin-left: inherit;
+margin-left: initial;
+margin-left: unset;
+
+ +

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

+ +

+ +
+
{{cssxref("<length>")}}
+
固定値によるマージンの寸法です。
+
{{cssxref("<percentage>")}}
+
包含ブロックの width に対するパーセントによるマージンの寸法です。
+
auto
+
左マージンは未使用の水平方向の余白を共有します。これは主に使用されているレイアウトモードによって決定されます。 margin-leftmargin-right の両方が auto の場合は、両方に均等に割り当てられます。それ以外の場合は以下の表のとおりです。 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{cssxref("display")}} の値{{cssxref("float")}} の値{{cssxref("position")}} の値auto の計算値コメント
inline, inline-block, inline-table任意static または relative0インラインレイアウトモード
block, inline, inline-block, block, table, inline-table, list-item, table-caption任意static または relative0。ただし margin-leftmargin-right が共に auto に設定されていた場合は、親要素の中で中央揃えする値に設定されます。ブロックレイアウトモード
block, inline, inline-block, block, table, inline-table, list-item, table-captionleft または rightstatic または relative0ブロックレイアウトモード (フロート要素)
table-* すべて、ただし table-caption を除く任意任意0内部の table-* 要素にはマージンがありません。代わりに {{ cssxref("border-spacing") }} を使用してください
flexinline-flex, table-* 以外のすべて任意fixed または absolute0。ただし margin-leftmargin-right が共に auto に設定されていた場合は、ボーダー領域を width の中で中央揃えする値に設定されます(固定されている場合)。絶対位置指定配置モード
flex, inline-flex任意任意0。ただし、水平に正の余白がある場合は、 auto を指定したすべてのマージンに均等に割り振られます。フレックスボックス配置モード
+
+
+ +

公式定義

+ +

{{cssinfo}}

+ +

形式文法

+ +{{csssyntax}} + +

+ +

ピクセル数とパーセント値を使用した左マージンの設定

+ +
.content { margin-left: 5%; }
+.sidebox { margin-left: 10px; }
+.logo    { margin-left: -5px; }
+
+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSS3 Box', '#propdef-margin-left', 'margin-left')}}{{Spec2('CSS3 Box')}}CSS 2.1 から目立った変更なし。
{{SpecName('CSS3 Flexbox', '#item-margins', 'margin-left')}}{{Spec2('CSS3 Flexbox')}}フレックス項目での margin-left の挙動を定義。
{{SpecName('CSS2.1', 'box.html#margin-properties', 'margin-left')}}{{Spec2('CSS2.1')}}CSS1 と同様、ただしインライン要素での効果は削除。
{{SpecName('CSS1', '#margin-left', 'margin-left')}}{{Spec2('CSS1')}}初回定義
+ +

ブラウザーの互換性

+ +

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

+ +

関連情報

+ + diff --git a/files/ja/web/css/margin-right/index.html b/files/ja/web/css/margin-right/index.html deleted file mode 100644 index 4eaaef539f..0000000000 --- a/files/ja/web/css/margin-right/index.html +++ /dev/null @@ -1,166 +0,0 @@ ---- -title: margin-right -slug: Web/CSS/margin-right -tags: - - CSS - - CSS Property - - Reference - - 'recipe:css-property' -translation_of: Web/CSS/margin-right ---- -
{{CSSRef}}
- -

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

- -
{{EmbedInteractiveExample("pages/css/margin-right.html")}}
- - - -

二つの隣り合うボックスの垂直マージンは融合することがあります。これはマージンの相殺と呼ばれています。

- -

構文

- -
/* <length> 値 */
-margin-right: 20px;  /* 絶対的な寸法 */
-margin-right: 1em;   /* 文字の寸法からの相対 */
-margin-right: 5%;    /* 直近のブロックコンテナーの幅からの相対 */
-
-/* キーワード値 */
-margin-right: auto;
-
-/* グローバル値 */
-margin-right: inherit;
-margin-right: initial;
-margin-right: unset;
-
- -

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

- -

- -
-
{{cssxref("<length>")}}
-
固定値によるマージンの寸法です。
-
{{cssxref("<percentage>")}}
-
包含ブロックの width に対するパーセントによるマージンの寸法です。
-
auto
-
右マージンは未使用の水平方向の余白を共有します。これは主に使用されているレイアウトモードによって決定されます。 margin-leftmargin-right の両方が auto の場合は、両方に均等に割り当てられます。それ以外の場合は以下の表のとおりです。 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{cssxref("display")}} の値{{cssxref("float")}} の値{{cssxref("position")}} の値auto の計算値コメント
inline, inline-block, inline-table任意static または relative0インラインレイアウトモード
block, inline, inline-block, block, table, inline-table, list-item, table-caption任意static または relative0。ただし margin-leftmargin-right が共に auto に設定されていた場合は、親要素の中で中央揃えする値に設定されます。ブロックレイアウトモード
block, inline, inline-block, block, table, inline-table, list-item, table-captionleft または rightstatic または relative0ブロックレイアウトモード (フロート要素)
table-* すべて、ただし table-caption を除く任意任意0内部の table-* 要素にはマージンがありません。代わりに {{ cssxref("border-spacing") }} を使用してください
flexinline-flex, table-* 以外のすべて任意fixed または absolute0。ただし margin-leftmargin-right が共に auto に設定されていた場合は、ボーダー領域を width の中で中央揃えする値に設定されます(固定されている場合)。絶対位置指定配置モード
flex, inline-flex任意任意0。ただし、水平に正の余白がある場合は、 auto を指定したすべてのマージンに均等に割り振られます。フレックスボックス配置モード
-
-
- -

公式定義

- -

{{cssinfo}}

- -

形式文法

- -{{csssyntax}} - -

- -

ピクセル数とパーセント値を使用した右マージンの設定

- -
.content { margin-right: 5%; }
-.sidebox { margin-right: 10px; }
-.logo    { margin-right: -5px; }
-
- -

仕様書

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('CSS3 Box', '#the-margin', 'margin-right')}}{{Spec2('CSS3 Box')}}目立った変更なし。
{{SpecName('CSS3 Flexbox', '#item-margins', 'margin-right')}}{{Spec2('CSS3 Flexbox')}}フレックス項目での margin-right の挙動を定義。
{{SpecName('CSS2.1', 'box.html#margin-properties', 'margin-right')}}{{Spec2('CSS2.1')}}CSS1 と同様、ただしインライン要素での効果は削除。
{{SpecName('CSS1', '#margin-right', 'margin-right')}}{{Spec2('CSS1')}}初回定義
- -

ブラウザーの互換性

- -

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

- -

関連情報

- - diff --git a/files/ja/web/css/margin-right/index.md b/files/ja/web/css/margin-right/index.md new file mode 100644 index 0000000000..4eaaef539f --- /dev/null +++ b/files/ja/web/css/margin-right/index.md @@ -0,0 +1,166 @@ +--- +title: margin-right +slug: Web/CSS/margin-right +tags: + - CSS + - CSS Property + - Reference + - 'recipe:css-property' +translation_of: Web/CSS/margin-right +--- +
{{CSSRef}}
+ +

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

+ +
{{EmbedInteractiveExample("pages/css/margin-right.html")}}
+ + + +

二つの隣り合うボックスの垂直マージンは融合することがあります。これはマージンの相殺と呼ばれています。

+ +

構文

+ +
/* <length> 値 */
+margin-right: 20px;  /* 絶対的な寸法 */
+margin-right: 1em;   /* 文字の寸法からの相対 */
+margin-right: 5%;    /* 直近のブロックコンテナーの幅からの相対 */
+
+/* キーワード値 */
+margin-right: auto;
+
+/* グローバル値 */
+margin-right: inherit;
+margin-right: initial;
+margin-right: unset;
+
+ +

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

+ +

+ +
+
{{cssxref("<length>")}}
+
固定値によるマージンの寸法です。
+
{{cssxref("<percentage>")}}
+
包含ブロックの width に対するパーセントによるマージンの寸法です。
+
auto
+
右マージンは未使用の水平方向の余白を共有します。これは主に使用されているレイアウトモードによって決定されます。 margin-leftmargin-right の両方が auto の場合は、両方に均等に割り当てられます。それ以外の場合は以下の表のとおりです。 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{cssxref("display")}} の値{{cssxref("float")}} の値{{cssxref("position")}} の値auto の計算値コメント
inline, inline-block, inline-table任意static または relative0インラインレイアウトモード
block, inline, inline-block, block, table, inline-table, list-item, table-caption任意static または relative0。ただし margin-leftmargin-right が共に auto に設定されていた場合は、親要素の中で中央揃えする値に設定されます。ブロックレイアウトモード
block, inline, inline-block, block, table, inline-table, list-item, table-captionleft または rightstatic または relative0ブロックレイアウトモード (フロート要素)
table-* すべて、ただし table-caption を除く任意任意0内部の table-* 要素にはマージンがありません。代わりに {{ cssxref("border-spacing") }} を使用してください
flexinline-flex, table-* 以外のすべて任意fixed または absolute0。ただし margin-leftmargin-right が共に auto に設定されていた場合は、ボーダー領域を width の中で中央揃えする値に設定されます(固定されている場合)。絶対位置指定配置モード
flex, inline-flex任意任意0。ただし、水平に正の余白がある場合は、 auto を指定したすべてのマージンに均等に割り振られます。フレックスボックス配置モード
+
+
+ +

公式定義

+ +

{{cssinfo}}

+ +

形式文法

+ +{{csssyntax}} + +

+ +

ピクセル数とパーセント値を使用した右マージンの設定

+ +
.content { margin-right: 5%; }
+.sidebox { margin-right: 10px; }
+.logo    { margin-right: -5px; }
+
+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSS3 Box', '#the-margin', 'margin-right')}}{{Spec2('CSS3 Box')}}目立った変更なし。
{{SpecName('CSS3 Flexbox', '#item-margins', 'margin-right')}}{{Spec2('CSS3 Flexbox')}}フレックス項目での margin-right の挙動を定義。
{{SpecName('CSS2.1', 'box.html#margin-properties', 'margin-right')}}{{Spec2('CSS2.1')}}CSS1 と同様、ただしインライン要素での効果は削除。
{{SpecName('CSS1', '#margin-right', 'margin-right')}}{{Spec2('CSS1')}}初回定義
+ +

ブラウザーの互換性

+ +

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

+ +

関連情報

+ + diff --git a/files/ja/web/css/margin-top/index.html b/files/ja/web/css/margin-top/index.html deleted file mode 100644 index fa48d0b5eb..0000000000 --- a/files/ja/web/css/margin-top/index.html +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: margin-top -slug: Web/CSS/margin-top -tags: - - CSS - - CSS Property - - Reference - - 'recipe:css-property' -translation_of: Web/CSS/margin-top ---- -
{{CSSRef}}
- -

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

- -
{{EmbedInteractiveExample("pages/css/margin-top.html")}}
- - - -

このプロパティは、置換要ではないインライン要素、例えば {{HTMLElement("span")}} や {{HTMLElement("code")}} には効果がありません。

- -

構文

- -
/* <length> 値 */
-margin-top: 10px;  /* 絶対的な寸法 */
-margin-top: 1em;   /* 文字の寸法からの相対 */
-margin-top: 5%;    /* 直近のブロックコンテナーの幅からの相対 */
-
-/* キーワード値 */
-margin-top: auto;
-
-/* グローバル値 */
-margin-top: inherit;
-margin-top: initial;
-margin-top: unset;
-
- -

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

- -

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

公式定義

- -

{{cssinfo}}

- -

形式文法

- -{{csssyntax}} - -

- -

正と負の上マージンの設定

- -
.content { margin-top:   5%; }
-.sidebox { margin-top: 10px; }
-.logo    { margin-top: -5px; }
-#footer  { margin-top:  1em; }
-
- -

仕様書

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

ブラウザーの互換性

- -

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

- -

関連情報

- - diff --git a/files/ja/web/css/margin-top/index.md b/files/ja/web/css/margin-top/index.md new file mode 100644 index 0000000000..fa48d0b5eb --- /dev/null +++ b/files/ja/web/css/margin-top/index.md @@ -0,0 +1,106 @@ +--- +title: margin-top +slug: Web/CSS/margin-top +tags: + - CSS + - CSS Property + - Reference + - 'recipe:css-property' +translation_of: Web/CSS/margin-top +--- +
{{CSSRef}}
+ +

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

+ +
{{EmbedInteractiveExample("pages/css/margin-top.html")}}
+ + + +

このプロパティは、置換要ではないインライン要素、例えば {{HTMLElement("span")}} や {{HTMLElement("code")}} には効果がありません。

+ +

構文

+ +
/* <length> 値 */
+margin-top: 10px;  /* 絶対的な寸法 */
+margin-top: 1em;   /* 文字の寸法からの相対 */
+margin-top: 5%;    /* 直近のブロックコンテナーの幅からの相対 */
+
+/* キーワード値 */
+margin-top: auto;
+
+/* グローバル値 */
+margin-top: inherit;
+margin-top: initial;
+margin-top: unset;
+
+ +

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

+ +

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

公式定義

+ +

{{cssinfo}}

+ +

形式文法

+ +{{csssyntax}} + +

+ +

正と負の上マージンの設定

+ +
.content { margin-top:   5%; }
+.sidebox { margin-top: 10px; }
+.logo    { margin-top: -5px; }
+#footer  { margin-top:  1em; }
+
+ +

仕様書

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

ブラウザーの互換性

+ +

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

+ +

関連情報

+ + diff --git a/files/ja/web/css/margin-trim/index.md b/files/ja/web/css/margin-trim/index.md new file mode 100644 index 0000000000..e0b68f051a --- /dev/null +++ b/files/ja/web/css/margin-trim/index.md @@ -0,0 +1,108 @@ +--- +title: margin-trim +slug: Web/CSS/margin-trim +tags: + - CSS + - CSS Property + - Draft + - Experimental + - NeedsContent + - NeedsExample + - NeedsLiveSample + - Reference + - recipe:css-property +browser-compat: css.properties.margin-trim +translation_of: Web/CSS/margin-trim +--- +{{CSSRef}} + +The `margin-trim` property allows the container to trim the margins of its children where they adjoin the container’s edges. + +## Syntax + +```css +margin-trim: none; +margin-trim: in-flow; +margin-trim: all; + +/* Global values */ +margin-trim: inherit; +margin-trim: initial; +margin-trim: revert; +margin-trim: unset; +``` + +## Values + +- `none` + - : Margins are not trimmed by the container. +- `in-flow` + + - : For in-flow boxes contained by this box, block-axis margins adjacent to the box's edges are truncated to zero. + + It also truncates any margins collapsed with such a margin. + +- `all` + - : Trims the margins of in-flow boxes and floats whose margins coincide with the container's content edge. + +## Formal definition + +{{cssinfo}} + +## Formal syntax + +{{csssyntax}} + +## Examples + +### Basic usage + +Once support is implemented for this property, it will probably work like so: + +When you've got a container with some inline children and you want to put a margin between each child but not have it interfere with the spacing at the end of the row, you might do something like this: + +```css +article { + background-color: red; + margin: 20px; + padding: 20px; + display: inline-block; +} + +article > span { + background-color: black; + color: white; + text-align: center; + padding: 10px; + margin-right: 20px; +} +``` + +The problem here is that you'd end up with 20px too much spacing at the right of the row, so you'd maybe do this to fix it: + +```css +span:last-child { + margin-right: 0; +} +``` + +It is a pain having to write another rule to achieve this, and it is also not very flexible. Instead, `margin-trim` could fix it: + +```css + article { + margin-trim: in-flow; + ... +} +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{CSSxRef("margin")}} diff --git a/files/ja/web/css/margin/index.html b/files/ja/web/css/margin/index.html deleted file mode 100644 index e8e2379d73..0000000000 --- a/files/ja/web/css/margin/index.html +++ /dev/null @@ -1,180 +0,0 @@ ---- -title: margin -slug: Web/CSS/margin -tags: - - CSS - - CSS プロパティ - - CSS 基本ボックスモデル - - Reference -translation_of: Web/CSS/margin -translation_of_original: Web/CSS/margin-new ---- -
{{CSSRef}}
- -

marginCSS のプロパティで、要素の全四辺のマージン領域を設定します。これはすべての個別のマージン ({{cssxref("margin-top")}}, {{cssxref("margin-right")}}, {{cssxref("margin-bottom")}}, {{cssxref("margin-left")}}) の一括指定です。

- -
{{EmbedInteractiveExample("pages/css/margin.html")}}
- - - -

top および bottom のマージンは、 {{HTMLElement("span")}} または {{HTMLElement("code")}} などの置換要素ではないインライン要素には効果がありません。

- -
-

注: マージンは要素の周りに追加の領域を作成します。それに対して、 {{cssxref("padding")}} は要素に追加の領域を作成します。

-
- -

構文

- -
/* 四辺すべてに適用 */
-margin: 1em;
-margin: -3px;
-
-/* 上下 | 左右 */
-margin: 5% auto;
-
-/* 上 | 左右 | 下 */
-margin: 1em auto 2em;
-
-/* 上 | 右 | 下 | 左 */
-margin: 2px 1em 0 auto;
-
-/* グローバル値 */
-margin: inherit;
-margin: initial;
-margin: unset;
-
- -

margin プロパティは1~4つの値を使って指定することができます。それぞれの値は <length><percentage>、 または auto キーワードです。負の数を指定すると、要素を既定よりも隣と近づけて描画します。

- - - -

- -
-
{{cssxref("length")}}
-
固定値によるマージンの寸法です。
-
{{cssxref("percentage")}}
-
内包ブロックの width に対するパーセントによるマージンの寸法です。
-
auto
-
ブラウザーが適切なマージンを選択して使用します。例えば、特定の場合に要素を中央揃えするためにこの値を使用します。
-
- -

形式文法

- -{{csssyntax}} - -

- -

単純な例

- -

HTML

- -
<div class="center">This element is centered.</div>
-
-<div class="outside">This element is positioned outside of its container.</div>
- -

CSS

- -
.center {
-  margin: auto;
-  background: lime;
-  width: 66%;
-}
-
-.outside {
-  margin: 3rem 0 0 -3rem;
-  background: cyan;
-  width: 66%;
-}
- -

{{ EmbedLiveSample('Simple_example','100%',120) }}

- -

その他の例

- -
margin: 5%;                /* 全辺: 5% のマージン */
-
-margin: 10px;              /* 全辺: 10px のマージン */
-
-margin: 1.6em 20px;         /* 上と下: 1.6em のマージン */
-                            /* 左と右: 20px のマージン  */
-
-margin: 10px 3% -1em;       /* 上:     10px のマージン */
-                            /* 左と右: 3% のマージン   */
-                            /* 下:     -1em のマージン  */
-
-margin: 10px 3px 30px 5px;  /* 上:     10px のマージン */
-                            /* 右:     3px のマージン  */
-                            /* 下:     30px のマージン */
-                            /* 右:     5px のマージン  */
-
-margin: 2em auto;           /* 上と下: 2em のマージン   */
-                            /* ボックスは水平方向に中央 */
-
-margin: auto;               /* 上と下: 0 のマージン     */
-                            /* ボックスは水平方向に中央 */
-
- -

- -

水平方向の中央揃え

- -

最近のブラウザーで何かを中央揃えしたい場合は、 display: flex; justify-content: center; を使用することができます。

- -

しかし、 IE8-9 のような古いブラウザーはフレックスボックスレイアウトに対応していないため、これは利用できません。親要素内で要素を中央揃えするのであれば、 margin: 0 auto; を使用してください。

- -

マージンの相殺

- -

要素の上下のマージンは、相殺されて2つのマージンのうち大きい方を取る単一のマージンになることがあります。詳しくはマージンの相殺の理解を参照してください。

- -

仕様書

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{ SpecName('CSS3 Box', '#margin', 'margin') }}{{ Spec2('CSS3 Box') }}有意な変更なし。
{{ SpecName('CSS3 Transitions', '#animatable-css', 'margin') }}{{ Spec2('CSS3 Transitions') }}margin をアニメーション可能として定義。
{{ SpecName('CSS2.1', 'box.html#margin-properties', 'margin') }}{{ Spec2('CSS2.1') }}インライン要素における top および bottom マージンの効果を削除。
{{ SpecName('CSS1', '#margin', 'margin') }}{{ Spec2('CSS1') }}初回定義
- -

{{cssinfo}}

- -

ブラウザーの互換性

- -

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

- -

関連情報

- - diff --git a/files/ja/web/css/margin/index.md b/files/ja/web/css/margin/index.md new file mode 100644 index 0000000000..e8e2379d73 --- /dev/null +++ b/files/ja/web/css/margin/index.md @@ -0,0 +1,180 @@ +--- +title: margin +slug: Web/CSS/margin +tags: + - CSS + - CSS プロパティ + - CSS 基本ボックスモデル + - Reference +translation_of: Web/CSS/margin +translation_of_original: Web/CSS/margin-new +--- +
{{CSSRef}}
+ +

marginCSS のプロパティで、要素の全四辺のマージン領域を設定します。これはすべての個別のマージン ({{cssxref("margin-top")}}, {{cssxref("margin-right")}}, {{cssxref("margin-bottom")}}, {{cssxref("margin-left")}}) の一括指定です。

+ +
{{EmbedInteractiveExample("pages/css/margin.html")}}
+ + + +

top および bottom のマージンは、 {{HTMLElement("span")}} または {{HTMLElement("code")}} などの置換要素ではないインライン要素には効果がありません。

+ +
+

注: マージンは要素の周りに追加の領域を作成します。それに対して、 {{cssxref("padding")}} は要素に追加の領域を作成します。

+
+ +

構文

+ +
/* 四辺すべてに適用 */
+margin: 1em;
+margin: -3px;
+
+/* 上下 | 左右 */
+margin: 5% auto;
+
+/* 上 | 左右 | 下 */
+margin: 1em auto 2em;
+
+/* 上 | 右 | 下 | 左 */
+margin: 2px 1em 0 auto;
+
+/* グローバル値 */
+margin: inherit;
+margin: initial;
+margin: unset;
+
+ +

margin プロパティは1~4つの値を使って指定することができます。それぞれの値は <length><percentage>、 または auto キーワードです。負の数を指定すると、要素を既定よりも隣と近づけて描画します。

+ + + +

+ +
+
{{cssxref("length")}}
+
固定値によるマージンの寸法です。
+
{{cssxref("percentage")}}
+
内包ブロックの width に対するパーセントによるマージンの寸法です。
+
auto
+
ブラウザーが適切なマージンを選択して使用します。例えば、特定の場合に要素を中央揃えするためにこの値を使用します。
+
+ +

形式文法

+ +{{csssyntax}} + +

+ +

単純な例

+ +

HTML

+ +
<div class="center">This element is centered.</div>
+
+<div class="outside">This element is positioned outside of its container.</div>
+ +

CSS

+ +
.center {
+  margin: auto;
+  background: lime;
+  width: 66%;
+}
+
+.outside {
+  margin: 3rem 0 0 -3rem;
+  background: cyan;
+  width: 66%;
+}
+ +

{{ EmbedLiveSample('Simple_example','100%',120) }}

+ +

その他の例

+ +
margin: 5%;                /* 全辺: 5% のマージン */
+
+margin: 10px;              /* 全辺: 10px のマージン */
+
+margin: 1.6em 20px;         /* 上と下: 1.6em のマージン */
+                            /* 左と右: 20px のマージン  */
+
+margin: 10px 3% -1em;       /* 上:     10px のマージン */
+                            /* 左と右: 3% のマージン   */
+                            /* 下:     -1em のマージン  */
+
+margin: 10px 3px 30px 5px;  /* 上:     10px のマージン */
+                            /* 右:     3px のマージン  */
+                            /* 下:     30px のマージン */
+                            /* 右:     5px のマージン  */
+
+margin: 2em auto;           /* 上と下: 2em のマージン   */
+                            /* ボックスは水平方向に中央 */
+
+margin: auto;               /* 上と下: 0 のマージン     */
+                            /* ボックスは水平方向に中央 */
+
+ +

+ +

水平方向の中央揃え

+ +

最近のブラウザーで何かを中央揃えしたい場合は、 display: flex; justify-content: center; を使用することができます。

+ +

しかし、 IE8-9 のような古いブラウザーはフレックスボックスレイアウトに対応していないため、これは利用できません。親要素内で要素を中央揃えするのであれば、 margin: 0 auto; を使用してください。

+ +

マージンの相殺

+ +

要素の上下のマージンは、相殺されて2つのマージンのうち大きい方を取る単一のマージンになることがあります。詳しくはマージンの相殺の理解を参照してください。

+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{ SpecName('CSS3 Box', '#margin', 'margin') }}{{ Spec2('CSS3 Box') }}有意な変更なし。
{{ SpecName('CSS3 Transitions', '#animatable-css', 'margin') }}{{ Spec2('CSS3 Transitions') }}margin をアニメーション可能として定義。
{{ SpecName('CSS2.1', 'box.html#margin-properties', 'margin') }}{{ Spec2('CSS2.1') }}インライン要素における top および bottom マージンの効果を削除。
{{ SpecName('CSS1', '#margin', 'margin') }}{{ Spec2('CSS1') }}初回定義
+ +

{{cssinfo}}

+ +

ブラウザーの互換性

+ +

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

+ +

関連情報

+ + diff --git a/files/ja/web/css/padding-bottom/index.html b/files/ja/web/css/padding-bottom/index.html deleted file mode 100644 index 8aa21ff9bb..0000000000 --- a/files/ja/web/css/padding-bottom/index.html +++ /dev/null @@ -1,110 +0,0 @@ ---- -title: padding-bottom -slug: Web/CSS/padding-bottom -tags: - - CSS - - CSS Padding - - CSS Property - - Reference - - 'recipe:css-property' -translation_of: Web/CSS/padding-bottom ---- -
{{CSSRef}}
- -

padding-bottomCSS のプロパティで、要素のパディング領域における下側の高さを設定します。

- -
{{EmbedInteractiveExample("pages/css/padding-bottom.html")}}
- - - -

要素のパディング領域とは、コンテンツと境界線の間の領域のことです。

- -

CSS の padding-bottom プロパティの要素ボックスへの影響

- -
-

注: {{cssxref("padding")}} プロパティは、単一の宣言で要素の四方のパディングをすべて設定することができます。

-
- -

構文

- -
/* <length> の値 */
-padding-bottom: 0.5em;
-padding-bottom: 0;
-padding-bottom: 2cm;
-
-/* <percentage> の値 */
-padding-bottom: 10%;
-
-/* グローバル値 */
-padding-bottom: inherit;
-padding-bottom: initial;
-padding-bottom: unset;
-
- -

padding-bottom プロパティは、以下のリスト内から選択した値で指定されます。マージンとは異なり、パディングには負の数は使用できません。

- -

- -
-
{{cssxref("<length>")}}
-
固定値によるパディングの寸法です。負の数であってはいけません。
-
{{cssxref("<percentage>")}}
-
包含ブロックの width に対するパーセント値によるパディングの寸法です。負の数であってはいけません。
-
- -

公式定義

- -

{{cssinfo}}

- -

形式文法

- -{{csssyntax}} - -

- -

ピクセル数とパーセント値で下パディングを設定

- -
.content { padding-bottom: 5%; }
-.sidebox { padding-bottom: 10px; }
-
- -

仕様書

- - - - - - - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('CSS3 Box', '#propdef-padding-bottom', 'padding-bottom')}}{{Spec2('CSS3 Box')}}変更なし。
{{SpecName('CSS2.1', 'box.html#padding-properties', 'padding-bottom')}}{{Spec2('CSS2.1')}}変更なし。
{{Specname('CSS1', '#padding-bottom', 'padding-bottom')}}{{Spec2('CSS1')}}初回定義
- -

ブラウザーの互換性

- -

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

- -

関連情報

- - diff --git a/files/ja/web/css/padding-bottom/index.md b/files/ja/web/css/padding-bottom/index.md new file mode 100644 index 0000000000..8aa21ff9bb --- /dev/null +++ b/files/ja/web/css/padding-bottom/index.md @@ -0,0 +1,110 @@ +--- +title: padding-bottom +slug: Web/CSS/padding-bottom +tags: + - CSS + - CSS Padding + - CSS Property + - Reference + - 'recipe:css-property' +translation_of: Web/CSS/padding-bottom +--- +
{{CSSRef}}
+ +

padding-bottomCSS のプロパティで、要素のパディング領域における下側の高さを設定します。

+ +
{{EmbedInteractiveExample("pages/css/padding-bottom.html")}}
+ + + +

要素のパディング領域とは、コンテンツと境界線の間の領域のことです。

+ +

CSS の padding-bottom プロパティの要素ボックスへの影響

+ +
+

注: {{cssxref("padding")}} プロパティは、単一の宣言で要素の四方のパディングをすべて設定することができます。

+
+ +

構文

+ +
/* <length> の値 */
+padding-bottom: 0.5em;
+padding-bottom: 0;
+padding-bottom: 2cm;
+
+/* <percentage> の値 */
+padding-bottom: 10%;
+
+/* グローバル値 */
+padding-bottom: inherit;
+padding-bottom: initial;
+padding-bottom: unset;
+
+ +

padding-bottom プロパティは、以下のリスト内から選択した値で指定されます。マージンとは異なり、パディングには負の数は使用できません。

+ +

+ +
+
{{cssxref("<length>")}}
+
固定値によるパディングの寸法です。負の数であってはいけません。
+
{{cssxref("<percentage>")}}
+
包含ブロックの width に対するパーセント値によるパディングの寸法です。負の数であってはいけません。
+
+ +

公式定義

+ +

{{cssinfo}}

+ +

形式文法

+ +{{csssyntax}} + +

+ +

ピクセル数とパーセント値で下パディングを設定

+ +
.content { padding-bottom: 5%; }
+.sidebox { padding-bottom: 10px; }
+
+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSS3 Box', '#propdef-padding-bottom', 'padding-bottom')}}{{Spec2('CSS3 Box')}}変更なし。
{{SpecName('CSS2.1', 'box.html#padding-properties', 'padding-bottom')}}{{Spec2('CSS2.1')}}変更なし。
{{Specname('CSS1', '#padding-bottom', 'padding-bottom')}}{{Spec2('CSS1')}}初回定義
+ +

ブラウザーの互換性

+ +

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

+ +

関連情報

+ + diff --git a/files/ja/web/css/padding-left/index.html b/files/ja/web/css/padding-left/index.html deleted file mode 100644 index 589c502943..0000000000 --- a/files/ja/web/css/padding-left/index.html +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: padding-left -slug: Web/CSS/padding-left -tags: - - CSS - - CSS Padding - - CSS Property - - Reference - - 'recipe:css-property' -translation_of: Web/CSS/padding-left ---- -
{{CSSRef}}
- -

padding-leftCSS のプロパティで、要素のパディング領域における左側の幅を設定します。

- -
{{EmbedInteractiveExample("pages/css/padding-left.html")}}
- - - -

要素のパディング領域とは、コンテンツと境界線の間の領域のことです。

- -
-

注: {{cssxref("padding")}} プロパティは、単一の宣言で要素の四方のパディングをすべて設定することができます。

-
- -

構文

- -
/* <length> の値 */
-padding-left: 0.5em;
-padding-left: 0;
-padding-left: 2cm;
-
-/* <percentage> の値 */
-padding-left: 10%;
-
-/* グローバル値 */
-padding-left: inherit;
-padding-left: initial;
-padding-left: unset;
-
- -

padding-left プロパティは、以下のリスト内から選択した値で指定されます。マージンとは異なり、パディングには負の数は使用できません。

- -

- -
-
{{cssxref("<length>")}}
-
固定値によるパディングの寸法です。負の数であってはいけません。
-
{{cssxref("<percentage>")}}
-
包含ブロックの width に対するパーセント値によるパディングの寸法です。負の数であってはいけません。
-
- -

公式定義

- -

{{cssinfo}}

- -

形式文法

- -{{csssyntax}} - -

- -

左パディングをピクセル数とパーセント値で設定

- -
.content { padding-left: 5%; }
-.sidebox { padding-left: 10px; }
-
- -

仕様書

- - - - - - - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('CSS3 Box', '#propdef-padding-left', 'padding-left')}}{{Spec2('CSS3 Box')}}変更なし。
{{SpecName('CSS2.1', 'box.html#padding-properties', 'padding-left')}}{{Spec2('CSS2.1')}}変更なし。
{{Specname('CSS1', '#padding-left', 'padding-left')}}{{Spec2('CSS1')}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("css.properties.padding-left")}}

- -

関連情報

- - diff --git a/files/ja/web/css/padding-left/index.md b/files/ja/web/css/padding-left/index.md new file mode 100644 index 0000000000..589c502943 --- /dev/null +++ b/files/ja/web/css/padding-left/index.md @@ -0,0 +1,108 @@ +--- +title: padding-left +slug: Web/CSS/padding-left +tags: + - CSS + - CSS Padding + - CSS Property + - Reference + - 'recipe:css-property' +translation_of: Web/CSS/padding-left +--- +
{{CSSRef}}
+ +

padding-leftCSS のプロパティで、要素のパディング領域における左側の幅を設定します。

+ +
{{EmbedInteractiveExample("pages/css/padding-left.html")}}
+ + + +

要素のパディング領域とは、コンテンツと境界線の間の領域のことです。

+ +
+

注: {{cssxref("padding")}} プロパティは、単一の宣言で要素の四方のパディングをすべて設定することができます。

+
+ +

構文

+ +
/* <length> の値 */
+padding-left: 0.5em;
+padding-left: 0;
+padding-left: 2cm;
+
+/* <percentage> の値 */
+padding-left: 10%;
+
+/* グローバル値 */
+padding-left: inherit;
+padding-left: initial;
+padding-left: unset;
+
+ +

padding-left プロパティは、以下のリスト内から選択した値で指定されます。マージンとは異なり、パディングには負の数は使用できません。

+ +

+ +
+
{{cssxref("<length>")}}
+
固定値によるパディングの寸法です。負の数であってはいけません。
+
{{cssxref("<percentage>")}}
+
包含ブロックの width に対するパーセント値によるパディングの寸法です。負の数であってはいけません。
+
+ +

公式定義

+ +

{{cssinfo}}

+ +

形式文法

+ +{{csssyntax}} + +

+ +

左パディングをピクセル数とパーセント値で設定

+ +
.content { padding-left: 5%; }
+.sidebox { padding-left: 10px; }
+
+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSS3 Box', '#propdef-padding-left', 'padding-left')}}{{Spec2('CSS3 Box')}}変更なし。
{{SpecName('CSS2.1', 'box.html#padding-properties', 'padding-left')}}{{Spec2('CSS2.1')}}変更なし。
{{Specname('CSS1', '#padding-left', 'padding-left')}}{{Spec2('CSS1')}}初回定義
+ +

ブラウザーの互換性

+ +

{{Compat("css.properties.padding-left")}}

+ +

関連情報

+ + diff --git a/files/ja/web/css/padding-right/index.html b/files/ja/web/css/padding-right/index.html deleted file mode 100644 index 85d9486bba..0000000000 --- a/files/ja/web/css/padding-right/index.html +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: padding-right -slug: Web/CSS/padding-right -tags: - - CSS - - CSS Padding - - CSS Property - - Reference - - 'recipe:css-property' -translation_of: Web/CSS/padding-right ---- -
{{CSSRef}}
- -

padding-rightCSS のプロパティで、要素のパディング領域における右側の幅を設定します。

- -
{{EmbedInteractiveExample("pages/css/padding-right.html")}}
- - - -

要素のパディング領域とは、コンテンツと境界線の間の領域のことです。

- -
-

注: {{cssxref("padding")}} プロパティは、単一の宣言で要素の四方のパディングをすべて設定することができます。

-
- -

構文

- -
/* <length> の値 */
-padding-right: 0.5em;
-padding-right: 0;
-padding-right: 2cm;
-
-/* <percentage> の値 */
-padding-right: 10%;
-
-/* グローバル値 */
-padding-right: inherit;
-padding-right: initial;
-padding-right: unset;
-
- -

padding-right プロパティは、以下のリスト内から選択した値で指定されます。マージンとは異なり、パディングには負の数は使用できません。

- -

- -
-
{{cssxref("<length>")}}
-
固定値によるパディングの寸法です。負の数であってはいけません。
-
{{cssxref("<percentage>")}}
-
包含ブロックの width に対するパーセント値によるパディングの寸法です。負の数であってはいけません。
-
- -

公式定義

- -

{{cssinfo}}

- -

形式文法

- -{{csssyntax}} - -

- -

右パディングをピクセル数とパーセント値で設定

- -
.content { padding-right: 5%; }
-.sidebox { padding-right: 10px; }
-
- -

仕様書

- - - - - - - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('CSS3 Box', '#propdef-padding-right', 'padding-right')}}{{Spec2('CSS3 Box')}}変更なし。
{{SpecName('CSS2.1', 'box.html#padding-properties', 'padding-right')}}{{Spec2('CSS2.1')}}変更なし。
{{Specname('CSS1', '#padding-right', 'padding-right')}}{{Spec2('CSS1')}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("css.properties.padding-right")}}

- -

関連情報

- - diff --git a/files/ja/web/css/padding-right/index.md b/files/ja/web/css/padding-right/index.md new file mode 100644 index 0000000000..85d9486bba --- /dev/null +++ b/files/ja/web/css/padding-right/index.md @@ -0,0 +1,108 @@ +--- +title: padding-right +slug: Web/CSS/padding-right +tags: + - CSS + - CSS Padding + - CSS Property + - Reference + - 'recipe:css-property' +translation_of: Web/CSS/padding-right +--- +
{{CSSRef}}
+ +

padding-rightCSS のプロパティで、要素のパディング領域における右側の幅を設定します。

+ +
{{EmbedInteractiveExample("pages/css/padding-right.html")}}
+ + + +

要素のパディング領域とは、コンテンツと境界線の間の領域のことです。

+ +
+

注: {{cssxref("padding")}} プロパティは、単一の宣言で要素の四方のパディングをすべて設定することができます。

+
+ +

構文

+ +
/* <length> の値 */
+padding-right: 0.5em;
+padding-right: 0;
+padding-right: 2cm;
+
+/* <percentage> の値 */
+padding-right: 10%;
+
+/* グローバル値 */
+padding-right: inherit;
+padding-right: initial;
+padding-right: unset;
+
+ +

padding-right プロパティは、以下のリスト内から選択した値で指定されます。マージンとは異なり、パディングには負の数は使用できません。

+ +

+ +
+
{{cssxref("<length>")}}
+
固定値によるパディングの寸法です。負の数であってはいけません。
+
{{cssxref("<percentage>")}}
+
包含ブロックの width に対するパーセント値によるパディングの寸法です。負の数であってはいけません。
+
+ +

公式定義

+ +

{{cssinfo}}

+ +

形式文法

+ +{{csssyntax}} + +

+ +

右パディングをピクセル数とパーセント値で設定

+ +
.content { padding-right: 5%; }
+.sidebox { padding-right: 10px; }
+
+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSS3 Box', '#propdef-padding-right', 'padding-right')}}{{Spec2('CSS3 Box')}}変更なし。
{{SpecName('CSS2.1', 'box.html#padding-properties', 'padding-right')}}{{Spec2('CSS2.1')}}変更なし。
{{Specname('CSS1', '#padding-right', 'padding-right')}}{{Spec2('CSS1')}}初回定義
+ +

ブラウザーの互換性

+ +

{{Compat("css.properties.padding-right")}}

+ +

関連情報

+ + diff --git a/files/ja/web/css/padding-top/index.html b/files/ja/web/css/padding-top/index.html deleted file mode 100644 index 365db61701..0000000000 --- a/files/ja/web/css/padding-top/index.html +++ /dev/null @@ -1,110 +0,0 @@ ---- -title: padding-top -slug: Web/CSS/padding-top -tags: - - CSS - - CSS Padding - - CSS Property - - Reference - - 'recipe:css-property' -translation_of: Web/CSS/padding-top ---- -
{{CSSRef}}
- -

padding-topCSS のプロパティで、要素のパディング領域における上側の高さを設定します。

- -
{{EmbedInteractiveExample("pages/css/padding-top.html")}}
- - - -

要素のパディング領域とは、コンテンツと境界線との間の空間のことです。

- -

CSS の padding-top プロパティの要素ボックスへの影響

- -
-

注: {{cssxref("padding")}} プロパティは、単一の宣言で要素の四方のパディングをすべて設定することができます。

-
- -

構文

- -
/* <length> の値 */
-padding-top: 0.5em;
-padding-top: 0;
-padding-top: 2cm;
-
-/* <percentage> の値 */
-padding-top: 10%;
-
-/* グローバル値 */
-padding-top: inherit;
-padding-top: initial;
-padding-top: unset;
-
- -

padding-top プロパティは、以下のリスト内から選択した値で指定されます。マージンとは異なり、パディングには負の数は使用できません。

- -

- -
-
{{cssxref("<length>")}}
-
固定値によるパディングの寸法です。負の数であってはいけません。
-
{{cssxref("<percentage>")}}
-
包含ブロックの width に対するパーセント値によるパディングの寸法です。負の数であってはいけません。
-
- -

公式定義

- -

{{cssinfo}}

- -

形式文法

- -{{csssyntax}} - -

- -

上パディングをピクセル数とパーセント値で設定

- -
.content { padding-top: 5%; }
-.sidebox { padding-top: 10px; }
-
- -

仕様書

- - - - - - - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('CSS3 Box', '#propdef-padding-top', 'padding-top')}}{{Spec2('CSS3 Box')}}変更なし。
{{SpecName('CSS2.1', 'box.html#padding-properties', 'padding-top')}}{{Spec2('CSS2.1')}}変更なし。
{{Specname('CSS1', '#padding-top', 'padding-top')}}{{Spec2('CSS1')}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("css.properties.padding-top")}}

- -

関連情報

- - diff --git a/files/ja/web/css/padding-top/index.md b/files/ja/web/css/padding-top/index.md new file mode 100644 index 0000000000..365db61701 --- /dev/null +++ b/files/ja/web/css/padding-top/index.md @@ -0,0 +1,110 @@ +--- +title: padding-top +slug: Web/CSS/padding-top +tags: + - CSS + - CSS Padding + - CSS Property + - Reference + - 'recipe:css-property' +translation_of: Web/CSS/padding-top +--- +
{{CSSRef}}
+ +

padding-topCSS のプロパティで、要素のパディング領域における上側の高さを設定します。

+ +
{{EmbedInteractiveExample("pages/css/padding-top.html")}}
+ + + +

要素のパディング領域とは、コンテンツと境界線との間の空間のことです。

+ +

CSS の padding-top プロパティの要素ボックスへの影響

+ +
+

注: {{cssxref("padding")}} プロパティは、単一の宣言で要素の四方のパディングをすべて設定することができます。

+
+ +

構文

+ +
/* <length> の値 */
+padding-top: 0.5em;
+padding-top: 0;
+padding-top: 2cm;
+
+/* <percentage> の値 */
+padding-top: 10%;
+
+/* グローバル値 */
+padding-top: inherit;
+padding-top: initial;
+padding-top: unset;
+
+ +

padding-top プロパティは、以下のリスト内から選択した値で指定されます。マージンとは異なり、パディングには負の数は使用できません。

+ +

+ +
+
{{cssxref("<length>")}}
+
固定値によるパディングの寸法です。負の数であってはいけません。
+
{{cssxref("<percentage>")}}
+
包含ブロックの width に対するパーセント値によるパディングの寸法です。負の数であってはいけません。
+
+ +

公式定義

+ +

{{cssinfo}}

+ +

形式文法

+ +{{csssyntax}} + +

+ +

上パディングをピクセル数とパーセント値で設定

+ +
.content { padding-top: 5%; }
+.sidebox { padding-top: 10px; }
+
+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSS3 Box', '#propdef-padding-top', 'padding-top')}}{{Spec2('CSS3 Box')}}変更なし。
{{SpecName('CSS2.1', 'box.html#padding-properties', 'padding-top')}}{{Spec2('CSS2.1')}}変更なし。
{{Specname('CSS1', '#padding-top', 'padding-top')}}{{Spec2('CSS1')}}初回定義
+ +

ブラウザーの互換性

+ +

{{Compat("css.properties.padding-top")}}

+ +

関連情報

+ + diff --git a/files/ja/web/css/padding/index.html b/files/ja/web/css/padding/index.html deleted file mode 100644 index 4f75859c83..0000000000 --- a/files/ja/web/css/padding/index.html +++ /dev/null @@ -1,167 +0,0 @@ ---- -title: padding -slug: Web/CSS/padding -tags: - - CSS - - CSS Padding - - CSS Property - - Reference - - 'recipe:css-shorthand-property' -translation_of: Web/CSS/padding ---- -
{{CSSRef}}
- -

paddingCSS一括指定プロパティで、要素の全四辺のパディング領域を一度に設定します。

- -
{{EmbedInteractiveExample("pages/css/padding.html")}}
- - - -

要素のパディング領域とは、コンテンツと境界線の間の領域のことです。

- -
-

注: パディングは要素の内部に追加の領域を作成します。それに対して、 {{cssxref("margin")}} は要素の周りに追加の領域を作成します。

-
- -

構成要素のプロパティ

- -

このプロパティは以下の CSS プロパティの一括指定です。

- - - -

構文

- -
/* 四辺すべてに適用 */
-padding: 1em;
-
-/* 上下 | 左右 */
-padding: 5% 10%;
-
-/* 上 | 左右 | 下 */
-padding: 1em 2em 2em;
-
-/* 上 | 右 | 下 | 左 */
-padding: 5px 1em 0 1em;
-
-/* グローバル値 */
-padding: inherit;
-padding: initial;
-padding: unset;
-
- -

padding プロパティは1つ、2つ、3つ、4つの値を使って指定することができます。それぞれの値は {{cssxref("<length>")}} または {{cssxref("<percentage>")}} です。負の数は無効です。

- - - -

- -
-
{{cssxref("<length>")}}
-
固定値によるパディングの寸法です。
-
{{cssxref("<percentage>")}}
-
コンテナーブロックのに対するパーセント値によるパディングの寸法です。
-
- -

公式定義

- -

{{cssinfo}}

- -

形式文法

- -{{csssyntax}} - -

- -

パディングをピクセル数で設定

- -

HTML

- -
<h4>This element has moderate padding.</h4>
-<h3>The padding is huge in this element!</h3>
-
- -

CSS

- -
h4 {
-  background-color: lime;
-  padding: 20px 50px;
-}
-
-h3 {
-  background-color: cyan;
-  padding: 110px 50px 50px 110px;
-}
-
- -

結果

- -

{{EmbedLiveSample('Setting_padding_with_pixels', '100%', 300)}}

- -

パディングをピクセル数とパーセント値で設定

- -
padding: 5%;                /* 全辺: 5% のパディング */
-
-padding: 10px;              /* 全辺: 10px のパディング */
-
-padding: 10px 20px;         /* 上と下: 10px のパディング */
-                            /* 左と右: 20px のパディング */
-
-padding: 10px 3% 20px;      /* 上:     10px のパディング */
-                            /* 左と右: 3% のパディング   */
-                            /* 下:     20px のパディング */
-
-padding: 1em 3px 30px 5px;  /* 上:     1em のパディング  */
-                            /* 右:     3px のパディング  */
-                            /* 下:     30px のパディング */
-                            /* 右:     5px のパディング  */ 
- -

仕様書

- - - - - - - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('CSS3 Box', '#padding-shorthand', 'padding')}}{{Spec2('CSS3 Box')}}変更なし。
{{SpecName('CSS2.1', 'box.html#propdef-padding', 'padding')}}{{Spec2('CSS2.1')}}変更なし。
{{Specname('CSS1', '#padding', 'padding')}}{{Spec2('CSS1')}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("css.properties.padding")}}

- -

関連情報

- - diff --git a/files/ja/web/css/padding/index.md b/files/ja/web/css/padding/index.md new file mode 100644 index 0000000000..4f75859c83 --- /dev/null +++ b/files/ja/web/css/padding/index.md @@ -0,0 +1,167 @@ +--- +title: padding +slug: Web/CSS/padding +tags: + - CSS + - CSS Padding + - CSS Property + - Reference + - 'recipe:css-shorthand-property' +translation_of: Web/CSS/padding +--- +
{{CSSRef}}
+ +

paddingCSS一括指定プロパティで、要素の全四辺のパディング領域を一度に設定します。

+ +
{{EmbedInteractiveExample("pages/css/padding.html")}}
+ + + +

要素のパディング領域とは、コンテンツと境界線の間の領域のことです。

+ +
+

注: パディングは要素の内部に追加の領域を作成します。それに対して、 {{cssxref("margin")}} は要素の周りに追加の領域を作成します。

+
+ +

構成要素のプロパティ

+ +

このプロパティは以下の CSS プロパティの一括指定です。

+ + + +

構文

+ +
/* 四辺すべてに適用 */
+padding: 1em;
+
+/* 上下 | 左右 */
+padding: 5% 10%;
+
+/* 上 | 左右 | 下 */
+padding: 1em 2em 2em;
+
+/* 上 | 右 | 下 | 左 */
+padding: 5px 1em 0 1em;
+
+/* グローバル値 */
+padding: inherit;
+padding: initial;
+padding: unset;
+
+ +

padding プロパティは1つ、2つ、3つ、4つの値を使って指定することができます。それぞれの値は {{cssxref("<length>")}} または {{cssxref("<percentage>")}} です。負の数は無効です。

+ + + +

+ +
+
{{cssxref("<length>")}}
+
固定値によるパディングの寸法です。
+
{{cssxref("<percentage>")}}
+
コンテナーブロックのに対するパーセント値によるパディングの寸法です。
+
+ +

公式定義

+ +

{{cssinfo}}

+ +

形式文法

+ +{{csssyntax}} + +

+ +

パディングをピクセル数で設定

+ +

HTML

+ +
<h4>This element has moderate padding.</h4>
+<h3>The padding is huge in this element!</h3>
+
+ +

CSS

+ +
h4 {
+  background-color: lime;
+  padding: 20px 50px;
+}
+
+h3 {
+  background-color: cyan;
+  padding: 110px 50px 50px 110px;
+}
+
+ +

結果

+ +

{{EmbedLiveSample('Setting_padding_with_pixels', '100%', 300)}}

+ +

パディングをピクセル数とパーセント値で設定

+ +
padding: 5%;                /* 全辺: 5% のパディング */
+
+padding: 10px;              /* 全辺: 10px のパディング */
+
+padding: 10px 20px;         /* 上と下: 10px のパディング */
+                            /* 左と右: 20px のパディング */
+
+padding: 10px 3% 20px;      /* 上:     10px のパディング */
+                            /* 左と右: 3% のパディング   */
+                            /* 下:     20px のパディング */
+
+padding: 1em 3px 30px 5px;  /* 上:     1em のパディング  */
+                            /* 右:     3px のパディング  */
+                            /* 下:     30px のパディング */
+                            /* 右:     5px のパディング  */ 
+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSS3 Box', '#padding-shorthand', 'padding')}}{{Spec2('CSS3 Box')}}変更なし。
{{SpecName('CSS2.1', 'box.html#propdef-padding', 'padding')}}{{Spec2('CSS2.1')}}変更なし。
{{Specname('CSS1', '#padding', 'padding')}}{{Spec2('CSS1')}}初回定義
+ +

ブラウザーの互換性

+ +

{{Compat("css.properties.padding")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf