[LOGO]
  Welcome
  Overview
  Structure
  Text
  Images & Links
 

Lists

  Tables
  Frames
  Style Sheets
  More Help
  Credits

Creating numbered or
bulleted lists in
your web pages

One of the most common ways to present information on the web is in the form of simple lists. The designers of HTML allowed for several different types of lists, and they can be nested, to create relatively complex structured information. Lists are famously the only part of the entire HTML specification which actually work as they're supposed to in all browsers, so let rip, and you won't have any nasty surprises. Here's how to make them:


<ul>
<li> . .
<li> . .
<li> . .
</ul>

Creates an unordered, indented list, with bullet points for each item. The <li> tag specifies a new item, which will be placed on a new line. Place the text you want to be displayed just after the tag. Here is a visual example of the result:

  • Here is the first item
  • And here's another one
  • This is the third and final item

<ol>
<li> . .
<li> . .
<li> . .
</ol>

An ordered list, which contains numbered items instead of bullet points. Otherwise, it works exactly like the unordered list above. Here is the output:

  1. Item number one
  2. And its successor, number two
  3. The final item, number three

<dl>
<dt> .
<dd> . .
<dt> .
<dd> . .
</dl>

A definition list, which is often a convenient way to display lists of short items with accompanying explanations. It should consist of alternating <dt> and <dd> tags, enclosed within the start and end tags. This is what you get:

Something
this is anything which isn't nothing
Nothing
this is everything which isn't something
Everything
this could be something and nothing combined

<ul>
<li> . .
<li> . .
  <ul>
  <li> . .
  <li> . .
  </ul>
<li> . .
</ul>

Generates a nested list, with two or more levels. It works in a logical manner: within an existing unordered list, you simply add another chunk of list items enclosed by their own pair of start and end tags. The nested list has different bullet points to make it easily distinguishable from the parent list:

  • Here is the first item of the parent list
  • And here's another one
    • This is a sublist item
    • of which there are only two
  • This is the final item of the parent list
  Welcome
  Overview
  Structure
  Text
  Images & Links
 

Lists

  Tables
  Frames
  Style Sheets
  More Help
  Credits

HTML Guide © 1996-2000 Alastair Stevens
Developed at the MRC Biostatistics Unit, Cambridge, UK