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/padding/index.html | 167 ------------------------------------ files/ja/web/css/padding/index.md | 167 ++++++++++++++++++++++++++++++++++++ 2 files changed, 167 insertions(+), 167 deletions(-) delete mode 100644 files/ja/web/css/padding/index.html create mode 100644 files/ja/web/css/padding/index.md (limited to 'files/ja/web/css/padding') 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