HTML and CSS Reference
In-Depth Information
The length unit em scales the indent as the font of the paragraph changes
in size on different browsers.
Hanging indents are a bit trickier, because you have to watch out for the
element borders. Negative indentation does not shift the left margin of
the text; it simply shifts the first line of the element left, possibly into
the margin, border, or padding of the parent element. For this reason,
hanging indents work as expected only if you also shift the left margin
of the element to the right by an amount equal to or greater than the
size of the hanging indent. For example:
p.wrong {text-indent: -3em}
p.hang {text-indent: -3em; margin-left: 3em}
p.large {text-indent: -3em; margin-left: 6em}
creates three paragraph styles. The first creates a hanging indent that
extends into the left margin, the second creates a conventional hanging
indent, and the third creates a paragraph whose body is indented more
than the hanging indent. Figure 8-9 shows all three styles in use.
Figure 8-9. The effects of text-indent and margin-left on
a paragraph
Search WWH ::




Custom Search