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


Unordered Lists

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

 

How to make an unordered list:


<UL>

Begin the unordered list



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

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



<UL>
<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



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

To end the unordered list, type the closing tag


 

How the unordered list looks:

  • The first item in the list
  • The second item in the list
  • The third item in the list

 

You can even nest a list inside of another list.

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

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:

  • The first item in the list
  • The second item in the list
    • The first sub item
    • The second sub item
      • One more sub item
    • The third sub item
  • The third item in the list


You may notice that the bullets are different for each nested list. I say "you may notice" because not all browsers will do this.

You can define how the bullets look for each list by inserting an attribute inside of either the <UL> tag or the <LI> tag.


How to define the bullet shape:

<UL TYPE=DISC>
<LI>The first item
<LI>The second item
<LI>The third item
</UL>

 

  • The first item
  • The second item
  • The third item

 

<UL TYPE=CIRCLE>
<LI>The first item
<LI>The second item
<LI>The third item
</UL>

 

  • The first item
  • The second item
  • The third item

 

<UL TYPE=SQUARE>
<LI>The first item
<LI>The second item
<LI>The third item
</UL>

 

  • The first item
  • The second item
  • The third item
<UL>
<LI TYPE=CIRCLE>The first item
<LI TYPE=DISC>The second item
<LI TYPE=SQUARE>The third item
</UL>

 

  • The first item
  • The second item
  • The third item

Click here if you like books.


Home
E-mail
Next

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

1