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. |
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 |
|
Yes | Yes | Yes | Yes | Yes |
An example showing how to use text-indent CSS property.
<!DOCTYPE HTML>
<html>
<head>
<style>
p {<!--from w w w . ja v a2 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>