Answers Search Help
Boston University home page
HTML: Intermediate
 
 
    Site Management
 
 
    Linking
 
 
 
 
 
 
    HTML Lists
 
 
 
 
    Tables
 
 
 
 
 
 
    Special Characters
 
 
    Supplementary
 
 
 
    Also See
   
   
   

Ordered Lists

An ordered list automatically numbers the items. Opening and closing tags are required. Line breaks are not required in lists. Each new item in the list assumes a new line.

<ol> - opening tag
</ol> - closing tag

You need to use a list item tag <li> for each item in your list.

Code Example:

Here are my favorite movies of the summer:<br>
<ol>
<li>The Iron Giant</li>
<li>Austin Powers: Spy Who Shagged Me</li> <li>Trick</li>
<li>Star Wars: Phantom Menace</li>
</ol>

Result:

Here are my favorite movies of the summer:

  1. The Iron Giant
  2. Austin Powers: Spy Who Shagged Me
  3. Trick
  4. Star Wars: Phantom Menace

You can create different types of lists by setting a type variable. Optional variables are:

  • type="A" -- list items are designated with uppercase letters (A, B, C, D, E ...)
  • type="a" -- list items are designated with lowercase letters (a, b, c, d, e ...)
  • type="I" -- list items are designated with uppercase Roman numerals (I, II, III, IV, V ...)
  • type="i" -- list items are designated with lowercase Roman numerals (i, ii, iii, iv, v ...)
  • type="1" -- list items are numbered (1, 2, 3, 4, 5 ...) NOTE: this is the default setting if no type option is applied.

You can also start a list at a value other than 1 with the start option. For instance, start="4" would start your list at the number 4. start="6" type="A" would start your list with the uppercase letter F.

Code Example:

Reading assignments:<br>
<ol type="1">
<li>Beginning HTML
<ol type="a">
<li>Document tags</li>
<li>Formatting tags</li>
<li>List tags</li>
</ol>
</li>
<li>Web Graphics
<ol type="a" START="4">
<li>Browser-safe colors</li>
<li>Optimizing the color palette</li>
<li>Copyright issues</li>
</ol>
</li>
<li>Web Publishing Guidelines</li>
</ol>

Result:

Reading assignments:

  1. Beginning HTML
    1. Document tags
    2. Formatting tags
    3. List tags
  2. Web Graphics
    1. Browser-safe colors
    2. Optimizing the color palette
    3. Copyright issues
  3. Web Publishing Guidelines

rule

WebCentral Using Publishing Learning Training Consulting WebCentral
Answers Search Help
NIS  |  OIT  |  Boston University  |   January 9, 2007