Basic HTML - Ordered and Unordered Lists
One of the easiest ways to add some organization to your blog posts is to use a list. People like lists and they can help you make your points in a post or on your website clearly and quickly. In HTML there are three types of lists:
- Ordered lists.
- Unordered lists.
- Definition lists.
For this post I will only look at ordered and unordered lists because those are the two most common types of lists. Definiation lists are useful as well and I will talk about them at a latter date.
Ordered Lists
An ordered list shows the list items starting with a number in front. A basic ordered list starts with the
- tag and each item in the list starts with the
- tag. At the end of each list item you should close the
- tag with a tag and when you are done your ordered list close the list with a closing
- Item one.
- Item two.
- Item three.
and it would be rendered like this:
- Item one.
- Item two.
- Item three.
Unordered Lists
An unordered list shows the list items starting with a bullet point in front. A basic unordered list starts with the
- tag and each item in the list starts with the
- tag. At the end of each list item you should close the
- tag with a tag and when you are done your unordered list close the list with a closing
- Item one.
- Item two.
- Item three.
and it would be rendered like this:
- Item one.
- Item two.
- Item three.
That is the basics of ordered and unordered lists in HTML. Lists are very flexible in HTML and can do some amazing things when combined with the correct styles in a cascading style sheet. For example the current main menu at the top of the site is actually an unordered list that is styled to display as a menu. The sidebar items are unordered list items styled without a bullet.