HTML Ordered Lists

The second type of HTML list is on the ordered list. You should use ordered lists when the order of the information is important, for example if you are describing a method of doing something, and you want it to be made clear that the list items must be done in that order. By default, ordered list items will be marked by numbers, although we can use CSS styles to change this to Roman numerals and more. Here is a typical ordered list, with the default numbering:

<li>Season chicken</li>
<li>Cook chicken for 30 minutes</li>
<li>Add pasta</li>

You will see that the code for ordered lists is almost identical to that for unordered lists; in fact the only difference is the opening and closing list tags - <ul> for unordered lists and <ol> for ordered lists.

As with unordered lists, you can nest ordered lists within one another to create more complex lists. In fact, you can list any list type within any other list type, so for example if you wanted an ordered list within an unordered list that would work fine.