B.111. text-indent

This property sets the indent applied to the first line of a block element (and its children, thanks to inheritance).

A negative value will result in a hanging indent, with the text of the first line protruding from the content area of the block. You will usually want to balance a negative text-indent with a positive padding-left value of the same or greater size to keep all the text within the border of the block.

Inherited: Yes

See also: Section B.79padding

B.111.1. Value

Any CSS length value (px, pt, em, etc.), or a percentage of the parent element's width.

Initial value: 0

B.111.2. Compatibility

CSS Version: 1

This property is supported by all CSS-compatible browsers.

B.111.3. Example

This style rule creates a one-centimeter ...

Get HTML Utopia: Designing Without Tables Using CSS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.