Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day

(singke) #1
ptg16476052

74 LESSON 5: Organizing Information with Lists


Output ▼


Customizing Ordered Lists


There are two customizations that are specific to ordered lists. The first enables you
to change the numbering style for the list, and the second enables you to change the
numbering itself. There are two ways to change the numbering style: the CSS property
list-style-type, and the type attribute, which is obsolete in HTML5. If you’re creating
a new ordered list, you should always use the CSS property, however, you may see
existing Web pages in which the type attribute is used instead.
Table 5.1 lists the numbering styles.

TABLE 5.1 Ordered List Numbering Styles
CSS Value Attribute Value Description
decimal 1 Standard Arabic numerals ( 1 , 2 , 3 , 4 , and so on)
lower-alpha a Lowercase letters (a, b, c, d, and so on)
upper-alpha A Uppercase letters (A, B, C, D, and so on)
lower-roman i Lowercase Roman numerals (i, ii, iii, iv, and so on)
upper-roman I Uppercase Roman numerals (that is, I, II, III, IV, and
so on)

You can specify types of numbering in the <ol> tag using the style attribute, like this:
<ol style="list-style-type: lower-alpha;">
By default, the decimal type is assumed.

FIGURE 5.1
An ordered list in
HTML.
Free download pdf