The Basics of Lists
I have noticed that most bloggers use lists of some sort in their articles. Lists tend to give structure to the article, it nakes things look more ordered and of course it generally just makes things easier to read. I have however come upon some strange looking lists and often it is these non-standard lists that are the cause of web pages not validating. I would like to have a quick look at just how lists should be included in our markup.
In HTML there are only 3 types of lists:
- unordered lists;
- ordered lists; and
- definition lists.
Let us have a look at each of these list types.
Unordered Lists
These are also often referred to as bulleted lists. These are the most common form of lists normally used. We should use these if the items in our list can be placed in any order e.g. a list of our friends:
- Tom.
- Dick.
- Harry.

Ordered Lists
These are also known as numbered lists. In an ordered list we place the items in a specific order. Let’s look at a list of student’s test results sorted from highest to lowest.
- Dick - 85%
- Harry - 79%
- Tom - 67%

Definition Lists
Definition lists do just that, they associate specific items and their definitions within the list. Let’s make a list of our household contents.
- Kitchen appliances
- Kettle
- Toaster
- Bathroom accessories
- Toothbrush
- Towels

Nesting
We can of course nest multiple instances of our lists within one another. Let’s make a list of our friends again but include each friends children.
- Tom
- Mary
- Jane
- Dick
- Jack
- Elizabeth
- Harry
- Patricia

We can also nest different types of lists within one another.
- Tom
- Mary - 18
- Likes
- Chocalate
- Cats
- Dislikes
- Brussell Sprouts
- Dogs
- Jane - 16
- Mary - 18
- Dick
- Jack - 16
- Elizabeth - 14
- Harry
- Patricia - 18

All the types of lists can be styled within our stylesheets but this would be the topic for a different article. Hopefully this has helped a little to get all our pages to validate. If our pages do not validate we cannot even hope to get our pages as accessible to as many as possible. Happy listing!
These posts might be related:








Hi, my name is Lyndi. Here we talk about all things related to WordPress. You are more than welcome to join in the discussion.


There are currently 107 posts with 952 comments on this blog.
Hi Sailor, nice and usefull article as always. I see you have changed your blog design. If you want I can make a nice header for this and free of course
shearyadis last blog post..Oh dear, another award for this humble blog
Again nice post. In hurry i always use ul tag. when i need numbers i should start using ol tag from now.
Nihars last blog post..July 2008 Statistics
I am glad I mentioned something you did not know about. It is especially cool using different lists within one another (my view).