CSS Indent Text - text-indent
Description
Use the text-indent property to horizontally indent text within block level html elements.
Default is 0px;
text-indent: length; /* e.g. 25px */
text-indent: percentage; /* e.g. 25% */
text-indent: inherit;
See also: text-decoration, text-align, text-transform, white-space.
Examples for text-indent
Example 1:
An example showing a 30 pixel indent:
A 30 pixel indent
<style>
#test { text-indent: 30px; border: 1px solid gray; }
</style>
<div id="test">A 30 pixel indent</div>
Example 2:
An example showing a 25% indent. Note the percentage refers to the parent block element width which in this case is 25% of the width of the div:
A 25% indent
<style>
#test2 { text-indent: 25%; border: 1px solid gray; }
</style>
<div id="test">A 25% indent</div>
Values for text-indent
| text-indent |
length percentage inherit |
Use the text-indent property to horizontally indent text within block level html elements. |