text-indent

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

Syntax

text-indent: <length> | <percentage> | inherit
Initial: 0
Applies To: block-level elements, table cells, and inline blocks
Inherited: yes
Percentages: refer to width of containing block
Media: visual

Values

text-indent: value
Value Description
length Fixed length identation
percentage Identation percentage calculated with respect to the width of the containing block

DOM

[window.]document.getElementById("element-id").style.textIndent = "text-indent";

Example | length

Example | percentage

Example | DOM

External

W3C Cascading Style Sheets, level 1

W3C Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification