The text-indent property specifies the indentation to be used in the first line of the element block. The indent is treated as a margin applied to the start edge of the line box.

  • Initial value0
  • Applies toBlock containers
  • InheritedYes
  • MediaVisual
  • Computed valuePercentage or absolute length
  • AnimatableNo
  • CSS VersionCSS1, CSS2, CSS3
  • JavaScript
Formal syntax: [ <length> | <percentage> ] && hanging? && each-line?

text-indent: 30px;
text-indent: 10%;
text-indent: hanging;
text-indent: each-line;
  • <length>Gives the amount of the indent as an absolute length.
  • <percentage>Gives the amount of the indent as a percentage of the containing block's logical width.
  • each-lineIndentation affects the first line of the block container as well as each line after a forced line break, but does not affect lines after a soft wrap break.
  • hangingInverts which lines are indented. All lines except the first line will be indented.
  • inherit
p {text-indent: 1em;}

Click the button below to experiment with this property.

Give it a Try!


Last updated on 23rd March 2014 By Rene Spronk

View All CSS Properties

Errors? Please help to keep this list up to date, If you find any errors, please contact us, so that we can get them fixed.