You are here: Reference > CSS > properties > text-indent

text-indent property

Browser support:
Specifies the horizontal indent for the first line of text.
JavaScript page for this property: textIndent. You can find other example(s) there.

Possible values:

 One of the following values: 
indent in length
The horizontal indent in length units. For the supported length units, see the length page.
indent in percentage
The indent is the specified percentage of the width of the parent object.
inherit
Takes the value of this property from the computed style of the parent element.
Default: 0.

Example HTML code 1:

This example illustrates the use of the text-indent property:
<head>
    <style>
        .indent40 {
            text-indent: 40px;
        }
        .indent100 {
            text-indent: 100px;
        }
    </style>
</head>
<body>
    <div class="indent40">
        This text is indented with 40px from left. It affects only the first line of this block.
    </div>
    <br />
    <div class="indent100">
        This text is indented with 100px from left. It affects only the first line of this block.
    </div>
</body>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content