tag, the type attribute may have a value of A for numbering with capital letters, a for numbering with lowercase letters, I for capital Roman numerals, i for lowercase Roman numerals, or 1
for common Arabic numerals. (See Table 8.1.)
Table 8.1: HTML Type Values for Numbering Ordered Lists
Type Value Generated Style
Sample Sequence
A
Capital letters
A, B, C, D
a
Lowercase letters
a, b, c, d
I
Capital Roman numerals
I, II, III, IV
i
Lowercase Roman numerals i, ii, iii, iv
1
Arabic numerals
1, 2, 3, 4
The start and type attribute extensions work in tandem. The start attribute sets the starting value of the item integer counter at the beginning of an ordered list. The type attribute sets the actual numbering style. For example, the following ordered list starts numbering items at 8, but because the style of numbering is set to i, the first number is the lowercase Roman numeral "viii." Subsequent items are numbered with the same style, each value incremented by 1 as shown in this example:
- This is the Roman number 8.
- The numerals increment by 1.
- And so forth...
The results are shown in
Figure 8.3.
Figure 8.3: The start and type attributes work in tandem
The type and value of individual items in a list can be different from the list as a whole, as described
in section Section 8.3.1, "Changing the Style and Sequence of Individual List Items".
8.2.1.3 Compact ordered lists
Like the unordered list, the ordered list in HTML has an optional compact attribute that is deprecated in the HTML 4.0 standard. Unless you absolutely need to use it, don't.
8.2.1.4 The class, dir, id, lang, event, style, and title attributes
These attributes are applicable as well with ordered lists and have identical effects as for unordered
lists. [The class and style attributes, 8.1.1.3] [The lang and dir attributes, 8.1.1.4]
[The id and title
attributes, 8.1.1.5]
[The event attributes, 8.1.1.6]
8.1 Unordered Lists
8.3 The
- Tag
Chapter 8
Formatted Lists
8.3 The - Tag
It should be quite obvious to you by now that the
- tag defines an item in a list. It's the universal tag for HTML list items in ordered (
) and unordered () lists, as we discuss earlier, and for directories () and menus (
; usually omitted
Contains:
flow
Used in:
list_content
Because the end of a list element can always be inferred by the surrounding document structure, most authors omit the ending tags for their list elements. That makes sense because it becomes easier to add, delete, and move elements around within a list. We recommend not using the end tag.
Although universal in meaning, there are some differences and restrictions to the use of the
- tag for each HTML list type. In unordered and ordered lists, what follows the
- tag may be nearly anything, including other lists and multiple paragraphs. Typically, if it handles indentation at all, the browser successively indents nested list items, and the content in those items is justified to the innermost indented margin.
Directory and menu lists are another matter. They are lists of short items like a single word or simple text blurb and nothing else. Consequently,
- items within and