[an error occurred while processing this directive]
Handouts » HTML Handouts » HTML Lists
Hypertext ListsSee also the CSS Lists handout. Lists in hypertext offer the only form of indentation available. Since HTML and ignores white space, formatting with the space bar of the keyboard will not provide the layout needed for some documents.
The list tags can be used with and without their notation (numbers and bullets) in order to center columns of text. Bear in mind that "centering" is a relative term and the windows of graphics can be changed by the reader, resulting in browser windows that vary in width from a few inches to 10 or more. So you are not really centering text, though it may appear centered in *your* window. You are merely indenting the text from the left.
Here are examples of three HTML list commands along with an approach that allows you to use bullets of your own making.
An Ordered (numbered) List in HTMLUse the <ol> tag to create numbered lists in Html. Note that you do not enter the "numbers" in the lists; the HTML language provides them. You will merely enter commands to *provide* numbers. The nice feature about the OL listing is that you don't have to keep track of the numbers themselves; you can insert and remove entries without screwing up the numbers.
You can select the type of numbers used with the type designation: type = =A|a|I|i|1
Figure 1 shows an ordered (numbered) list of internet tools Tools can be divided into roughly two genres: online search tools and software you run on your local machine.
Figure 1 displays 2 sets of nested <ol> tags. You can see the formatted hypertext below:
An Unordered List With Bullets
This is an Unordered list. That means the listed text is indented from the left margin and tagged with bullets (the asterisk in lynx; round dots in graphics browsers), rather than being numbered, like with the <ol>. Begin each line with the <li> tag to place the bullet. If you *omit* the <li> tag the line will be indented but no bullet will be presented. Notice how the following entries are indented under this paragraph.
You can choose the appearance of the bulets with the type designation, as in
The HTML Definition List
The definition list is a kind of column format and uses 3 tags, <dl>, <dt> and <dd>. The <dl> opens the list; </dl> closes the list. <dt> marks the "term to be defined", positioning it to the left. The <dd> marks the "definition OF the term". This text is usually runs about a paragraph in length and appears indented underneath the "term".
In this case the <dl> has been entered on the line below the title (A Definition List on Internet Tools). The <dt> tag is entered before the 2 terms, Gopher and Veronica (there is no closing tag for <dt>). The <dd> tag is entered before the definition of the terms; it has no closing tag either.
Here is the formatted text
Notice that is doesn't matter whether you enter the <dt> and <dd> terms on the same line or on separate lines. The browsers will merge them in together in the correct format.
Last Edited: 11 Mar 2012