HTML : Text formatting
Jérôme Versavel
Lists
To list various items in a category or the successive steps in a workshop, HTML provides two sorts of lists:
unordered ones (often rendered with bullets) and
ordered ones (rendered with a numbering).
A bulleted list is set by the
<UL> tag, and each item is defined by the
<LI> tag.
The following code:
<UL>
<LI>Red</LI>
<LI>Green</LI>
<LI>Blue</LI>
</UL>
produces the following result:
To define numbered lists, use the
<OL> tag. The same <LI> tag is used to define each list item.
The following code:
<OL>
<LI>Yellow</LI>
<LI>Cyan</LI>
<LI>Magenta</LI>
</OL>
displays as follows:
- Yellow
- Cyan
- Magenta
Nested lists. A list item can also be a list in its own right, as shown in this table of contents example:
- Webmaster
- Tips
- Site selection
- Lab books
- Folders
- Newsmag