From W3C Wiki
Jump to: navigation, search


The text-indent property specifies the indentation of the first line of text in a block container.


Values <length> | <percentage> | inherit
Initial value 0
Applies to block containers
Inherited Yes

Point, Note

  • This property only affects a first line of an element.


  • <length>
    The indentation is a fixed length.

  • <percentage>
    The indentation is a percentage of the containing block width.

  • inherit
    Takes the same specified value as the property for the element's parent.


Example A


 p {
   width: 300px;
   border: 1px solid black;
   text-indent: 1em;


    <p>CSS is a Style Sheet Language for formatting the document content 
       (written in HTML or other markup language). You might be interested 
       by the CSS Working Group wiki too.</p>

Csslist2 text-indent.png

CSS Reference

The CSS specification defines the text-indent property in 16.1 Indentation.