text-indent

Description

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

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

Syntax and Property Values


text-indent: length | percentage | inherit 

The property values are listed in the following table.

ValueDescription
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

Example


<!DOCTYPE HTML>
<html>
    <head>
        <style>
            p {<!--from   w  w  w  . j a  va2  s .c  o  m-->
                text-indent: 25%;
                width: 200px;
            }
        </style>
    </head>
<body>
    <p>
       This is a test. This is a test. This is a test. This is a test. 
    </p>
</body>
</html>

Click to view the demo

The code above generates the following result.

text-indent




















Home »
  HTML CSS »
    HTML CSS Reference »




HTML Tag Reference
CSS Reference
CSS Selector Reference
Encoding Reference