CSStext -indentプロパティ
例
テキストの最初の行を異なる値でインデントします。
div.a {
text-indent: 50px;
}
div.b {
text-indent: -2em;
}
div.c {
text-indent:
30%;
}
定義と使用法
このtext-indent
プロパティは、テキストブロックの最初の行のインデントを指定します。
注: 負の値を使用できます。値が負の場合、最初の行は左にインデントされます。
デフォルト値: | 0 |
---|---|
遺伝性の: | はい |
アニメート可能: | はい。アニメート可能について読む |
バージョン: | CSS1 |
JavaScript構文: | オブジェクト.style.textIndent = "50px" |
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
Property | |||||
---|---|---|---|---|---|
text-indent | 1.0 | 3.0 | 1.0 | 1.0 | 3.5 |
CSS構文
text-indent: length|initial|inherit;
プロパティ値
Value | Description | Play it |
---|---|---|
length | Defines a fixed indentation in px, pt, cm, em, etc. Default value is 0. Read about length units | |
% | Defines the indentation in % of the width of the parent element | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
関連ページ
CSSチュートリアル:CSSテキスト
HTML DOMリファレンス:textIndentプロパティ