CSS Property text-indent

This can be used to create a tab effect. Negative values are permitted and cause outdent effects.


Initial value 0
Inherited Yes.
JavaScript syntax
Applies to Block-level elements.

CSS Syntax

text-indent: length | percentage | inherit 

Property Values

The property values are listed in the following table.

auto Default value. The browser does the calculation.
length Set width in px, cm, etc.
% Set width in percent of the containing element
inherit Inherit the width property from the parent element

Browser compatibility

Yes Yes Yes Yes Yes


An example showing how to use text-indent CSS property.

            p {<!--from   w  w  w .  ja v a2 s.c  o m-->
                text-indent: 25%;
                width: 200px;
       This is a test. This is a test. This is a test. This is a test. 

Click to view the demo