|
HTML recognises several different types of list. The code below makes probably the simplest kind of list, the
unordered list.
<UL>
The <UL>...</UL> tags mark the beginning and end of the list, while each item in the list is surrounded by a
<LI>...</LI> tag pair. For the majority of browsers the closing </LI> tag is not really necessary,
but is specified in the official HTML specification. Notice that we don't need a <BR> linebreak tag at
the end of each item -- this is implied in the <LI> tag.
The code shown above will place a bullet point in front of each list item (normally a large dot). In some browsers
you can specify different bullet points by extending the <UL> tag like this:
<UL TYPE=CIRCLE> or <UL
TYPE=SQUARE>
If you want your list to be numbered or lettered, then you can use an ordered list. The coding is very
similar to the unordered list:
<OL>
The code used above will number the list items 1, 2, 3 etc. As with the <UL> tag, we can extend the opening
tag and thereby specify other numbering or lettering:
We can also specify where the numbering or lettering should start from. For example, if we want a numbered list
starting with 4, we could use this code:
<OL TYPE="1" START=4>
A different type of list is the definition list. Each item in the list consists of two parts, the definition
term and the definition data:
<DL>
Many web page designers use the definition list as a means of indenting text:
This is not good practice -- it doesn't follow the HTML specification and is therefore not guaranteed to
work!
Finally, there are two other types of lists, the menu list and the directory list. These are coded in
the same way as the unordered list, except that the <UL>...</UL> tags are replaced with
<MENU>...</MENU> or <DIR>...</DIR> tags. Most browsers do not distinguish between these
types of lists, showing them all as if they were unordered lists.
Try making the different types of lists, and also have a look at the different ways of numbering/lettering and
ordered list. When you're ready, go on to the next section about Creating a
Form.
|
|||||||||||||||
|
Last major revision: 22 August 1998 at 02:29 BST |
a member of |