CSS GUIDE TEXT INDENT

From CDOT Wiki
Jump to: navigation, search

This document is a work in progress and is subject to change.

Summary

The text-indent indents the first line of text in an element. The property asks for the length of the indentation.

Applicability:The text-indent property can be used for all block-level elements, table cells and inline blocks.
Media Group: Visual
Inherited:Yes

Syntax

p
{ 
text-indent: 20px
}

Legal Values

The following measurements can be used:

  • cm (centimeter)
  • em (ems)
  • inch (inches)
  • mm (millimeters)
  • pc (picas)
  • px (pixels)
  • pt (points)
  •  % (percentage of block width)

Negative number can also be used, but the text will be indented to the left (potentially cutting off some characters).

See usage examples section for more details.

Mozilla Recommended Values

Usage Examples

text-indent: 20px  /*Indent 20 pixels.*/
text-indent: -12px  /*Indent 12 pixels to the left.*/

Notes

Specification Conformance

Browser Compatibility

See Also