Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

CSS text-indent property


May 06, 2021 CSS Reference Manual


Table of contents


CSS text-indent property


Indent the first line of the paragraph by 50 pixels:

P
{
text-indent:50px;
}

Try it out . . .

Description of property definition and use

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

Note: Negative values are allowed. If the value is negative, indent the first row to the left.

Default: 0
Inherited: yes
Version: CSS1
JavaScript syntax: object .style.textIndent="50px"


Browser support

The numbers in the table support the first browser version number of the property.

Attributes
text-indent 1.0 3.0 1.0 1.0 3.5

The property value

Value Describe
length Define a fixed indentation. Default: 0.
% Defines an indentation based on a percentage of the width of the parent element.
inherit Specifies that the value of the text-indent property should be inherited from the parent element.


Related articles

CSS tutorial: CSS text