English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
text-The indent CSS attribute specifies the indentation of the first line of text within an element.
The following table explains the usage and version history of this attribute, as well as its usage syntax in JavaScript scripts.
Default value: | 0 |
---|---|
Applicable to: | Block and inline block elements, table cells |
Inheritance: | Yes |
Can be animated: | Yes.Please refer to Animation attributes. |
Version: | CSS 1,2,3 |
JavaScript syntax: | object.style.textIndent="50px" |
The syntax of this attribute is as follows:
text-indent: length | percentage | initial | inherit
The following examples demonstrate how to use text-indent attribute.
p { text-indent: 100px; }Test to see‹/›
The following table describes the value of this attribute.
Value | Description |
---|---|
length | Specify a fixed length indentation. Negative values are allowed. |
percentage | Indent is the percentage (%) of the containing block width. Negative percentage values can be used. |
initial | Set this attribute to its default value. |
inherit | If specified, the associated element adopts its parent element text-The value of the indent attribute. |
text-Browser compatibility of the indent attribute; the numbers in the table below represent the minimum browser version that supports this attribute; all mainstream browsers support this attribute.
|
Please refer to the following tutorials:CSS text,CSS margin.
Text-related attributes:letter-spacing,text-align,text-decoration,text-overflow,text-shadow,text-transform,white-space,word-spacing.