--- Lists ---
[ Previous Section | Home | Index | Test Your HTML | Related links | Next Section ]



Lists are a very useful element in building a webpage. They allow you to organize many things, from a list of your favorite books to a list of services your company offers. Below are discussed a few types of lists, each with its own special properties.



List Item


<LI> ... </LI>

- This is a tag common to all but one of the lists below. It says that whatever comes after it is a separate and individual item in a list. It has a closing tag but does not need one. However, if decide not to use the closing tag, </LI>, be careful, because everything after <LI> will be a part of that list item until the browser runs into another <LI> or the end of the list, </UL>, </OL>, and so on.



Unordered List


<UL> .... </UL>

- This is the unordered list. All the items in this list will appear vertically, one after another, with a bullet (a dot) before every item in the list. Though it is "unordered," this does not mean that you can't place the items in the order in which you want them.


Example:

<UL>
<LI> Item 1
<LI> Item 2
<LI> Item 3
</UL>
  • Item 1
  • Item 2
  • Item 3




Ordered List


<OL> .... </OL>

- The ordered list is very much like the unordered list except that every item in the ordered list is preceded by a number instead of a bullet. The numbers begin at 1 and end at how many items you have in the list. This type of list is extremely useful when giving directions for cooking or anything else that requires things to be done in the right order.


Example:

<OL>
<LI> Item 1
<LI> Item 2
<LI> Item 3
</OL>
  1. Item 1
  2. Item 2
  3. Item 3




Definition List


<DL> .... </DL>

- The definition list lists its items much like a dictionary might list definitions, hence from where it takes its name. The definition list has 2 essential tags as a part of it, <DT> and <DD>.


<DT>

- The "definition term" or <DT> is very much like the word in a dictionary entry. The item placed after b><DT> is aligned with the left-hand side of the page.


<DD>

- Much like the "definition term" was like the word in a dictionary entry, the "definition definition" is much like the definition of a word. Anything placed after <DD> is indented a little bit to set it off from the "term."

Although the definition list is more associated with dictionary definitions, it can be used in many other ways in which some "term" needs "defining" or explaining.



Example:


<DL>
<DT>First item:
<DD>The first item in this definition list.
<DT>Second item:
<DD>The second item in this definition list.
<DT>Third item:
<DD>The third item in this definition list.
</DL>
First item:
The first item in this definition list.
Second item:
The second item in this definition list.
Third item:
The third item in this definition list.




[ Previous Section | Home | Index | Test Your HTML | Related links | Next Section ]