From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/css/text-indent/index.html | 137 ++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 files/ja/web/css/text-indent/index.html (limited to 'files/ja/web/css/text-indent') diff --git a/files/ja/web/css/text-indent/index.html b/files/ja/web/css/text-indent/index.html new file mode 100644 index 0000000000..72f47374bf --- /dev/null +++ b/files/ja/web/css/text-indent/index.html @@ -0,0 +1,137 @@ +--- +title: text-indent +slug: Web/CSS/text-indent +tags: + - CSS + - CSS テキスト + - CSS プロパティ + - Reference + - レイアウト +translation_of: Web/CSS/text-indent +--- +
{{CSSRef}}
+ +

CSS の text-indent プロパティは、ブロック内のテキストの行の前に置く空白 (字下げ) の幅を設定します。

+ +
{{EmbedInteractiveExample("pages/css/text-indent.html")}}
+ + + +

包含ブロック要素のコンテンツボックスの左端 (右書きの場合は右端) に、水平に空白が挿入されます。

+ +

構文

+ +
/* <length> 値 */
+text-indent: 3mm;
+text-indent: 40px;
+
+/* <percentage> 値
+   包含ブロックの幅に対する割合 */
+text-indent: 15%;
+
+/* Keyword values */
+text-indent: 5em each-line;
+text-indent: 5em hanging;
+text-indent: 5em hanging each-line;
+
+/* Global values */
+text-indent: inherit;
+text-indent: initial;
+text-indent: unset;
+
+ +

+ +
+
{{cssxref("<length>")}}
+
{{cssxref("<length>")}} を絶対値として字下げが指定されます。負の値も許可されます。利用できる単位は {{cssxref("<length>")}} をご覧ください。
+
{{cssxref("<percentage>")}}
+
包含ブロックの幅の {{cssxref("<percentage>")}} 分だけ字下げされます。
+
each-line {{experimental_inline}}
+
強制的な改行の後の各行も、ブロックコンテナーの先頭行と同様に字下げします。ただし自動折り返しの次の行はインデントしません。
+
hanging {{experimental_inline}}
+
インデントされる行が逆になります。つまり、先頭行以外のすべての行を字下げします。
+
+ +

形式文法

+ +
{{csssyntax}}
+ +

単純なインデントの例

+ +

HTML

+ +
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
+    nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
+<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
+    nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
+
+ +

CSS

+ +
p {
+  text-indent: 5em;
+  background: powderblue;
+}
+ +

{{ EmbedLiveSample('Simple_indent','100%','100%') }}

+ +

パーセント表記のインデントの例

+ +

HTML

+ +
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
+    nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
+<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
+    nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
+ +

CSS

+ +
p {
+  text-indent: 30%;
+  background: plum;
+}
+ +

{{ EmbedLiveSample('Percentage_indent_example','100%','100%') }}

+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSS3 Text', '#text-indent-property', 'text-indent')}}{{Spec2('CSS3 Text')}}hangingeach-line キーワードを追加。
{{SpecName('CSS3 Transitions', '#animatable-css', 'text-indent')}}{{Spec2('CSS3 Transitions')}}text-indent がアニメーション可能に。
{{SpecName('CSS2.1', 'text.html#indentation-prop', 'text-indent')}}{{Spec2('CSS2.1')}}display: inline-block と無名ブロックボックスの場合の動作が明確に定義されるようになりました。
{{SpecName('CSS1', '#text-indent', 'text-indent')}}{{Spec2('CSS1')}}Initial definition.
+ +

{{cssinfo}}

+ +

ブラウザーの対応

+ + + +

{{Compat("css.properties.text-indent")}}

-- cgit v1.2.3-54-g00ecf