We can create bulleted or numbered lists in html easily using the ul, ol and li tags.

Here’s an example of an unordered list:


Note that every time we open a tag, we close it again in the correct order. Tags are always completely enclosed in their parent tags.


  1. Create an unordered (bulleted) list on your page. Bonus points for imagination.
  2. Change it to an ordered list.


We can nest lists inside other lists to get sublists, like so:


Exercise 2

  1. Add a sublist.
  2. On a piece of paper, draw the tree diagram that represents your code.
  3. Optionally add a sub-sublist.
  4. Draw the new tree diagram and ask me to check it.

Uses of lists

Lists are most commonly used in HTML for navigation. When you think about it, a site navigation is really just a list of hyperlinks.

With CSS we can style a list any way we like, as buttons, as a horizontal strip, as dropdowns, as a header, as a hierarchical sidebar. We’ll see more on this later.