Lesson 7

Lists

Types of lists

There are two types of lists in HTML: ordered and unordered. both types of list are indented on the page. Individual items in an ordered list are preceded by a number while items in an unordered list are preceded by a bullet. (see below)

Here is an ordered list:
  1. Get out of bed.
  2. Use the bathroom.
  3. Get dressed.
  4. Go to the kitchen.
  5. Put the kettle on!

and here is an unordered list:

Here are the relevant tags for lists:

Start tag End tag
Ordered list <ol> </ol>
Unordered list <ul> </ul>
Each item <li> </li>

Click here to see a simpler page with lists that you can examine.

Nested lists

Warning

Sometimes you may have a need to nest one list within another list. This can be easily done, but there is a trap that we all fall into! Remember that the nested list has to be part of one of the items in the nesting list. To see how this is done, click here.

Previous Lesson previous lesson next lesson Next Lesson