Maddog's HTML for Real People Chapter 8, Lesson 4


[INDEX] Ch 8, L 4 - Ordered (Numbered) Lists

If you already know how to create an ordered list in HTML, you can skip this lesson.

Often, you want to create a numbered list, i.e., one where each list item is numbered (1., 2., 3., ..., n.). This is easy to do in HTML, following the general rules and guidelines we learned for making unordered lists, but substituting a new Ordered List tag pair:

<OL> </OL>

The general format for an ordered list then becomes:

<OL>
list heading text (if any) goes here <BR>
<LI> list item (text, images, and/or links)
<LI> another list item (text, images, and/or links)
</OL>

As you can see, this format is nearly identical to that for unordered lists. Instead of bullets, however, the browser is going to supply sequential numbers, in this case '1.' for the first list item, and '2.' for the second list item.

Here's a quick example:

HTML Source Code Follows:

<OL>
<U><B>Things Shakespeare is NOT Famous For</B></U> <BR>
<LI> inventing the macarena
<LI> judging chili cook-offs 
<LI> wearing trashy lipstick
</OL>
(End of HTML Source Code)

Demonstration Follows:

    Things Shakespeare is NOT Famous For
  1. inventing the macarena
  2. judging chili cook-offs
  3. wearing trashy lipstick

(Demonstration Ends)

In the example, notice how the browser took care of numbering the list items for us (we just told it that we wanted an ordered list, and it did the rest). Most browsers use the numeric sequence as the default for ordered lists. Also, to improve the list's readability, we underlined the heading, using the '<U> </U>' tag pair, which was introduced in an earlier chapter.


-PREVIOUS- -CHAPTER- -INDEX- -NEXT-

Overseer: Monty Northrup ... maddog@io.com ... leave e-mail ...
...to maddog 'n' miracles homepage...