Weaving
your Webpage
Lists
There are three kinds of lists in HTML: ordered, unordered, and a special kind called a definition list.
In ordered lists the browsers take care of inserting the actual numbers. This behavior is convenient for authors because if you insert or delete items in a sorted list, you don't have to worry about renumbering everything. An ordered list begins with <ol> and ends with </ol>.
Unordered lists typically use bullets to mark off each item in the list, but this is up to the browser (a DOS browser may use asterixes or dashes, for example). An unordered list begins with <ul> and ends with </ul>.
In both kinds of lists, the individual items are designated with a <li> command. It is not necessary to separate items in a list with <p> commands.
You can also nest lists to get an outline effect.
Here's a sample document with a few lists thrown in:
<html> <head> <title>Constellations</title> </head> <body>
<h1>Constellations</h1>
Cultures from all over the world have made up stories about the star patterns they see in the night sky<p>
<h2>What is a constellation?</h2>
<p> Constellations are pictures made up from the patterns that the stars form in the night sky.</p>
Here's an ordered list:<p> <ol> <li> first item. <li> second item. <li> third item
</ol>
<p> Here's an unordered list:</p>
<ul> <li> an item. <li> another item. <li> here's a nested list <ul> <li> a nested item <li> another nested item </ul> <li> the last item </ul>
<p> The mythologies and legends about the constellations have been passed down over the generations.</p>
</body> </html>
This is what the list above would look like when rendered with your browser:
Here's an ordered list:
1.first item. 2.second item. 3.third item.
Here's an unordered list:
first item. another item. Here's a nested list a nested item another nested item the last item
Definition Lists
A definition list is a very flexible type of list that is more useful than its name implies. It's useful for lists where a bit of explanatory text should accompany each item. Each item in the list has two parts, a term (indicated with the <dt> command) and a definition (which uses the <dd> command). The list itself is started with a <dl> command and closed with a </dl> command.
Here's a sample definition list:
<dl> <dt> First Term <dd> First term's definition. <dt> Second term (or title, or whatever) <dd> Text that explains or expands on the second term. </dl>
And This is what it would look like in your browser:
First Term First term's definition. Second term (or title, or whatever) Text that explains or expands on the second term.