| Lists |
| HTML provides three list types: ordered, unordered and discursive. You can nest lists inside lists (either of the same type or of different types). |
| Ordered Lists |
| Ordered lists are numbered, starting from 1, each
"point" is placed on a new line, but without
extra space between it and the next point. An ordered
list starts with the <ol> tag. Each point
starts with the <li> tag and should end with
the </li> tag, but most people leave the end
tag off! |
| Syntax |
HTML |
Text |
|---|---|---|
<ol> |
<ol> |
|
| HTML provides three list types: ordered, unordered and discursive. You can nest lists inside lists (either of the same type or of different types). |
| Ordered Lists - Netscape Extensions |
| In addition to numeric numbering of list items, Ordered lists have been revamped to allow various kinds of list numbering. |
<ol type=A|a|I|i|1> |
| In addition to the type of "numbering", you can also set the start value. This is done by specifying the numeric value of the starting item; so if the type=A, and you want the list to start at J, then specify start=10. |
<ol start=KK> |
where KK is the numeric value of the start. |
| The type of the "numbering" can be specified with the <li> tag itself! The start attribute is not used (unfortunately!), instead the value attribute is used to set the value of the current list item (and restart the "count"). |
<li type=A|a|I|i|1> |
where KK is the numeric value of the start. |
| Unordered Lists |
| Unordered lists have basically the same syntax as ordered lists, except that the <ul>.....</ul> tags replace the <ol>.....</ol> tags! The result is a list with bullets instead of numbers. |
| Syntax |
HTML |
Text |
|---|---|---|
<ul> |
<ul> |
|
| Unordered Lists - Netscape Extensions |
| Unordered Lists, have been extended to allow the type of bullet to be specified. |
<ul
type=disc|circle|square> |
| Note that on many browsers disc and circle appear the same. You can also specify the bullet type with the <li> tag itself! |
<li type=disc|circle|square> |
| It may not surprise you to know that you can, in fact, use the <li> tag outside of a list! It is similar to when used inside an unordered list, except that the paragraph is not indented and nor are the lines following the first indented in from the point. |
| Syntax |
HTML |
Text |
|---|---|---|
<li> ... </li> |
<li>This is the First
Point of a number of points</li> |
|
| Indented Paragraphs |
| One non-standard use of the <ul> tag, is
to produce indented paragraphs. For every <ul>
tag, the text is indented further. Be aware that while
this is supported (by Netscape) at present, it may not be
supported by all browsers or by any
browsers in the future. A better solution would be to use a Table... |
| Syntax |
HTML |
Text |
|---|---|---|
<ul> ...
<ul> ...
...
</ul>
</ul>
|
<ul>This text is
indented |
This text is still indented |
| Discursive Lists |
| Discursive lists are more complicated than either of
the other lists, because each "point" has a
"term" (enclosed in <dt>...</dt>)
and a "definition" (enclosed in <dd>...</dd>).
Each point should include only one <dt>...</dt>
& <dd>...</dd> pair. Note that, as with the other list types, the end </dt> and </dd> tags can be left off, but the end list tag </dl> must NOT be ignored. |
| Syntax |
HTML |
Text |
|---|---|---|
<dl> |
<dl> |
|
Go to next section: Tables or return to the Contents page. |
||
| Last Updated: 19 August 1999 | ||