Little Web Hut

CSS 2.1 Reference: text-indent Property

CSS text-indent Property
Syntax
selector {text-indent: value ;}
Usage

The text-indent property is used to control the indentation of the first line of text within a block container.

This property is specified by using a length, percentage, or keyword, according to the syntax shown above. Negative values are permitted but this may cause the text to overflow the block container if the negative value is too large. If a percentage value is used, the value will be a percentage of the block container's width.


CSS Example: The text-indent property is set using a length of 25 pixels.
  p {text-indent: 25px;}
Test It HTML StyleTest It XHTML StyleTest It HTML5 Style

Keywords
  • inherit - The inherit keyword is used to specify that the value for this property should be taken from the parent element. If inherit is used with the root element, then the initial value for this property will be used.
Applies To Block containers
Inherited Yes
Initial Value 0


text-indent Property Examples
Test It HTML StyleTest It HTML StyleTest It HTML5 StyleThe text-indent property is set using a length of 25 pixels.