HTML and CSS Reference
In-Depth Information
■
As you have just seen, ordered lists resume the sequence when you back out of a nested list. However, if
you follow a list with a paragraph or any other type of element, the sequence always restarts at 1. To continue a numeric
sequence after a break, use the
start
attribute in the opening
<ol>
tag. For example,
<ol start=
"4">
continues
a list at item 4. The
start
attribute was deprecated in HTMl 4.01 and XHTMl 1.0 in favor of CSS. unfortunately,
the CSS method of resuming numbering after a break is complex. Thankfully, the W3C saw the error of its ways, and
restored the
start
attribute to HTMl5. Chapter
15
explains how CSS counters work.
Tip
Changing the Position of the Symbol
h
e
list-style-position
property accepts just two values, namely:
inside
Th is tucks the bullet or number inside the list item, so that it is ush with the
left edge in left-to-right languages like English
.
outside
Th is is the default position, which puts the bullet or number outside the list
item like a hanging indent.
Th e styles in list-style-position.html include the following class:
.inside {
list-style-position: inside;
}
Th e class has been applied to the unordered and ordered lists on the right of Figure
10-8
. As a result, the
symbols and numbers are tucked into the rst line of each item. Th
e lists on the left use the default style, which
leaves the bullets and numbers outside the list items.
Figure 10-8.
h
e symbol or number can be positioned outside the list item or tucked into the rst line