Text-indent in CSS

Text-indent in CSS

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

text-indent: 2em;

This shifts the first line to the right by the specified amount.

Key Points ^-^

  • Common units: px, em

  • em adapts to font size, making it scalable

  • Often used in long-form content for clean paragraph starts

  • Can be negative to pull the first line left

A small touch that adds classic flow to your layout.