April 2005
Intermediate to advanced
336 pages
6h 33m
English
Another very useful text property is text-indent. This enables you to indent text with CSS instead of spacer graphics or numerous nonbreaking space characters in your HTML.
You can use any length value (described earlier this chapter) that is fixed.
p {text-indent: 45px;}
This results in each paragraph having an initial indentation of 45 pixels (see Figure 9-10).
Figure 9-10. Indenting paragraphs with a 45-pixel indent.

You can use percentage values, too, which will be relative to the element's containing box (more on that in Chapter 12, “Positioning, Floats, and Z-index”):
p {text-indent: 40%;}
This results in a deep indentation, ...
Read now
Unlock full access