Style textIndent Property

Style Object Reference Style Object


Indent the first line of a <div> element with 50 pixels:


Try it yourself »

Definition and Usage

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

Note: Negative values are allowed. The first line will be indented to the left if the value is negative.

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The textIndent property is supported in all major browsers.


Return the textIndent property:

Set the textIndent property:"length|%|initial|inherit"

Property Values

Value Description
length Defines the indentation in length units. Default value is 0
% Defines the indentation in % of the width of the parent element
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

Technical Details

Default Value: 0
Return Value: A String, representing the indentation of the first line of text in the element
CSS Version CSS1

More Examples


Return the text indentation of a <div> element:


Try it yourself »

Related Pages

CSS tutorial: CSS Text

CSS reference: text-indent property

Style Object Reference Style Object


Color Picker