10.0 Lists
This portion of the document gives a nested set of lists which both
demonstrate and describe the HTML list features. The TYPE= attribute (used
here) is deprecated and you're supposed to use the list-style CSS property
instead. The outermost list in the following material is an unordered list
<UL>.
- Types of lists. (This item begins with a LI tag and is followed by a
nested OL list in the default style.)
- UL tag: unordered (bullet) lists.
- OL tag: ordered lists, with numbers, like this one.
- DL tag: definition list, with alternating phrases and definitions.
- List items. (This item begins with a LI tag and is followed by a
nested DL list.)
- UL
- The LI tag is used for the items. It is super-block level,
in the sense that a multi-paragraph list item should have coherent
margins, as if contained within the LI element.
(Here's a second paragraph.) The </LI> tag
is normally omitted, being inferred from the next LI or the list's
end tag.
- OL
- The LI tag is also used for ordered lists.
- DL
- An item in a definition list consists of the sequence
<DT>(term)<DD>(definition). No block-level content is
allowed in the term, while block-level content such as multiple
paragraphs is allowed in the definition. The corresponding end
tags are normally omitted.
- List type codes. The format is <UL TYPE="whatever">
and similarly for OL. The type attribute is deprecated and the CSS
style property list-style should be used instead.
- UL bullet types:
- There are several choices for a UL:
- Type="disc"
-
- Type="circle"
-
- Type="square"
-
- Custom bullet via style effect. Style="list-style-image:URL(the_url)"
-
- OL numbering styles:
- There are five choices for a OL:
- Type=1 (Arabic)
- Item one.
- Item two.
- Type=a (lower case alphabetic)
- Item one.
- Item two.
- Type=A (upper case alphabetic)
- Item one.
- Item two.
- Type=i (lower case Roman)
- Item one.
- Item two.
- Type=I (upper case Roman)
- Item one.
- Item two.
- DL formatting types:
- There are no defined types for a
definition list.
- Sequence control in ordered lists. This OL starts with item five
(set by the START attribute) and breaks the sequential order using the
VALUE attribute on LI. Integers (Arabic) are used for these values,
but the Roman list type is demonstrated.
- This is item V due to START=5 on OL.
- This is item VI in sequential order.
- This is item X due to VALUE=10 on LI.
- This is item XI in sequential order.
- This is item 12 in sequential order, overriding the type.
When lists are nested the browser will generally cycle through the
various list types. Here's a demonstration for unordered lists (UL).
Each list has only one item which consists of a descriptive text followed
by the next more deeply nested list.
- Item at nesting level one.
- Item at nesting level two.
- Item at nesting level three.
- Item at nesting level four.
- Item at nesting level five.
- Item at nesting level six.
Here's the same thing with ordered lists.
- Item at nesting level one.
- Item at nesting level two.
- Item at nesting level three.
- Item at nesting level four.
- Item at nesting level five.
- Item at nesting level six.