CSS text-indent
Property
Topic: CSS3 Properties ReferencePrev|Next
Description
The text-indent
CSS property specifies the indent in the first line of text within an element.
The following table summarizes the usages context and the version history of this property.
Default value: | 0 |
---|---|
Applies to: | Block and inline-block elements, table cells |
Inherited: | Yes |
Animatable: | Yes. See animatable properties. |
Version: | CSS 1, 2, 3 |
Syntax
The syntax of the property is given with:
The example below shows the text-indent
property in action.
Example
Try this code »p {
text-indent: 100px;
}
Property Values
The following table describes the values of this property.
Value | Description |
---|---|
length | Specifies a fixed length indentation. Negative length Values are allowed. |
percentage | The indentation is a percentage (%) of the containing block width. Negative percentage Values are allowed. |
initial |
Sets this property to its default value. |
inherit |
If specified, the associated element takes the computed value of its parent element text-indent property. |
Browser Compatibility
The text-indent
property is supported in all major modern browsers.
Basic Support—
|
Further Reading
See tutorial on: CSS Text, CSS Margin.
Text-related properties: letter-spacing
, text-align
, text-decoration
, text-overflow
, text-shadow
, text-transform
, white-space
, word-spacing
.