text-indent
Description
This can be used to create a tab effect. Negative values are permitted and cause outdent effects.
Item | Value |
---|---|
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.
Value | Description |
---|---|
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>
The code above generates the following result.