Unordered Lists
Definition Lists
HTML for People Who Want to Learn  --  Lists for Starters


Ordered Lists

Ordered lists are very useful when you want to make a list where the order of the list items is important. Ordered lists are also very easy to make. To begin an ordered list, type <OL>. Begin each item in the list with <LI>, which signifies a "list item". When you are finished with the list, type the closing tag, </OL>.

 

How to make an ordered list:


<OL>

Begin the ordered list



<OL>
<LI>The first item in the list

Type <LI> before each list item
(<LI> does not require a closing tag)



<OL>
<LI>The first item in the list
<LI>The second item in the list
<LI>The third item in the list

Insert all the items of the list



<OL>
<LI>The first item in the list
<LI>The second item in the list
<LI>The third item in the list
</OL>

To end the ordered list, type the closing tag


 

How the ordered list looks:

  1. The first item in the list
  2. The second item in the list
  3. The third item in the list

 

You can even nest a list inside of another list.

<OL>
<LI>The first item in the list
<LI>The second item in the list
   <OL>
   <LI>The first sub item
   <LI>The second sub item
        <OL>
        <LI>One more sub item
        </OL>
   <LI>The third sub item
   </OL>
<LI>The third item in the list
</OL>

NOTE: Each nested list in the example above is indented for readability. The spacing does not effect the rendering of the lists.


This is what it looks like:

  1. The first item in the list
  2. The second item in the list
    1. The first sub item
    2. The second sub item
      1. One more sub item
    3. The third sub item
  3. The third item in the list


You can define how the list is numbered by inserting an attribute inside of either the <OL> tag or the <LI> tag. You can even define what number the list should start at.


How to define the numbering:

<OL TYPE=A>
<LI>The first item
<LI>The second item
<LI>The third item
</OL>


  1. The first item
  2. The second item
  3. The third item

 

<OL TYPE=a>
<LI>The first item
<LI>The second item
<LI>The third item
</OL>


  1. The first item
  2. The second item
  3. The third item

 

<OL TYPE=I>
<LI>The first item
<LI>The second item
<LI>The third item
</OL>


  1. The first item
  2. The second item
  3. The third item

 

<OL TYPE=i>
<LI>The first item
<LI>The second item
<LI>The third item
</OL>


  1. The first item
  2. The second item
  3. The third item

 

<OL TYPE=1>
<LI>The first item
<LI>The second item
<LI>The third item
</OL>


  1. The first item
  2. The second item
  3. The third item
<OL START=4>
<LI>The fourth item
<LI>The fifth item
<LI>The sixth item
</OL>


  1. The fourth item
  2. The fifth item
  3. The sixth item

Click here if you like books.


Back
Home
E-mail
Next

Last Modified: Saturday, 25-Jul-98 10:21:38 PDT
Page URL: http://geocities.datacellar.net/SiliconValley/Vista/2823/lists_ol.html

1