HTML Lists

HTML lists are perfect for when you want to present information in a structured way. There are three types of HTML list - unordered lists, ordered lists and definition lists.

All HTML list types share a very similar basic structure - first you use an opening HTML tag to mark the start of the list, then you mark each list item with a separate "list item" tag, and finally you end the list using the closing HTML tag.

As well as creating simple lists it is also possible to put lists within other lists. This is known as nesting. Using nesting we can create some very complex lists, and the HTML will tell the browser how to present it all so that it is simple to follow.

Here is an example of an unordered HTML list, in the form of a "to do" list with some nested items, to give you an idea of what to expect:

  • Pay car insurance
  • Go to the gym
  • Visit Mary
    • Pay her the money I owe her
    • Ask if you can borrow her garden hose
  • Buy some beer

Now let's move on and look at each list type in detail.