Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style textIndent Property

Style textIndent Property

Style Object Reference The Style object


Definition and Usage

The textIndent property sets or returns the indentation of the first line of text.

Syntax

Set the textIndent property:

Object.style.textIndent="

length|%

|inherit"

Return the textIndent property:

Object.style.textIndent

Value Description
length Defines the indentation using units such as px, cm, etc. The default value is 0.
% Defines the indentation as a percentage of the parent element's width.
inherit The value of the textIndent property is inherited from the parent element.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the textIndent property.

**Note:** IE7 and earlier versions do not support the "inherit" value. IE8 supports "inherit" only if a !DOCTYPE is specified. IE9 supports "inherit".


Example

Example

Indent the text:

Runoob Tutorial(runoob.com)

This is some text. This is some text.

This is some text. This is some text.

This is some text. This is some text.

This is some text. This is some text.

This is some text. This is some text.


Try it »


Style Object Reference The Style object