XML technologies / CSS / Advanced websites with CSS / CSS property reference / text-indent

(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)

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

A negative value creates a hanging indent, with the first line extending to the left of the block element’s content.

Inherited: yes

See also: padding

Values

A CSS measurement or a percentage of the parent element’s width.

Default value: 0

Compatibility

CSS version: 1

Works in all CSS-capable browsers.

Example

The following style rule gives all paragraphs p a hanging indent combined with equally sized left padding:

p {
 text-indent: -1cm;
 padding-left: 1cm;
}

  

 

 

 

back to top