CSS text-indent property
Example
Indent the first line of a paragraph by 50 pixels:
p
{
text-indent:50px;
}
Try it »
Property definition and usage
The text-indent property specifies the indentation of the first line of text in a text block.
Note: Negative values are allowed. If the value is negative, the first line is indented to the left.
| Default value: | 0 |
|---|---|
| Inherited: | yes |
| Version: | CSS1 |
| JavaScript syntax: | object.style.textIndent="50px" |
Browser support
The numbers in the table indicate the first browser version that supports this property.
| property | |||||
|---|---|---|---|---|---|
| text-indent | 1.0 | 3.0 | 1.0 | 1.0 | 3.5 |
Attribute values
| Value | Description |
|---|---|
| length | Defines a fixed indentation. Default value: 0. |
| % | Defines an indentation based on a percentage of the parent element's width. |
| inherit | Specifies that the value of the text-indent property should be inherited from the parent element. |
Related Articles
CSS Tutorial: CSS Text