By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

CSS Text-indent Property

Reference on the css text-indent property.

Edited: 2016-01-10 03:57

The text-indent property of CSS sets the indention of text contained in an element, and is typically applied to paragraphs, but it also works on other elements.

The text-indent property can be useful if you wish to slightly indent the first line of text in a paragraph. If you want to indent the entire paragraph, consider use the margin properties instead.

If an element contains more text than there is room for, the text will wrap to the next line without the indention from the first line.

p {
  text-indent: 1em;
}

Possible Values

Read Units of Measurement to understand the values.

Inherited? YES!

CSS Text-indent example

The following example will create a "Note." paragraph in the content of a page, something which is quite common. The typical way to markup a note is to use p and strong, like done in the below example:

<p style="text-indent:1em;"><strong>Note.</strong> The text-indent property will only affect the first line of text. If this is undesired use margin or padding instead.</p>

Which would result in an effect like the below:

Note. The text-indent property will only affect the first line of text. If this is undesired use margin or padding instead.