Writing HTML | About | FAQ | Tags | back | next |

6. Lists, Lists, Lists
Lists can present items of information in an easy-to-read format. In fact, there is a list right here, lurking under the next heading!
Objectives
After this lesson, you will be able to:
Lesson
Many web pages display lists of items- these may be items preceded with a "bullet" (Unordered) or a sequentially numbered list (Ordered). These lists are easy to format in HTML, and they may even be nested (lists of lists) to produce an outline format. Lists are also handy for creating an index or table of contents to a series of documents or chapters.
Unordered Lists
Unordered Lists, or ul tags, are ones that appear as a list of items with "bullets" or markers in the front. The bullet marks will depend on the particular version of your web browser and the font specified for displaying normal WWW text (i.e. for Macintosh, the bullets are the option-8 character- in Times font this is a small square, in Geneva it is a large round dot).
My Unordered List:
Here is an example of an unordered list:
And this is the HTML format for producing this format:
<B>My Unordered List:</B>
<ul>
<li> Item 1
<li> Item 2
<li> Item 3
</ul>
The <ul> tag marks the beginning and end of the list, and the <li> indicates each list item.
Ordered Lists
Ordered lists are ones where the browser numbers each successive list item starting with "1." Note that the only difference is changing the ul tag to ol tag. Using the example from above:
My Ordered List:
Here is an example of an ordered list:
And this is the HTML format for producing this format:
<B>My Ordered List:</B>
<ol>
<li> Item 1
<li> Item 2
<li> Item 3
</ol>
Nested Lists
Ordered Lists and Unordered lists can have different levels, each will be indented appropriately by your web browser. Your major concern will be to verify that each list is properly terminated and the nesting order is correct.
It can start to look complicated with all of those <ol> <li> </ul> <li> tags floating around, but just try to remember the basic structure
<ul> <ol>
<li> <li>
<li> <li>
</ul> </ol>
Here is an example of an unordered list with sub levels of other lists:
Nested Unordered List
Here is an example of another list:
Note how the bullet marks change for different levels of the list.
And this is the HTML format for producing this format:
<ul><B>Nested Unordered List</B>
<li>This is the first item
<li>This is the second item
<ul>
<li> This is the first sub item of the second item
<ul>
<li> And this is a sub item of a sub item
<li> Getting lost yet?
</ul>
<li> This is the second sub item of the second item
<li> This is the third sub item of the second item
</ul>
<li>This is the third item
</ul>
Nested Lists - Mixing them together
Not only can you include ordered lists within ordered lists, but you can also mix and match list types. Hold onto your hats! The HTML starts to look pretty ugly, but watch how lists completely contain other lists.
For example, this ordered list includes a nested unordered list:
Nested Unordered List
Here is the example:
And this is the HTML format for producing this format. Note how the HTML has been indented to make it easier to read:
<B>Nested Unordered List</B>
<ol>
<li>This is the first item
<li>This is the second item
<ul>
<li> This is the first sub item of the second item
<ol>
<li> An this is a numbered subItem of a sub item
<li> An this is another numbered sub item of a sub item
<li> Getting lost yet?
</ol>
<li> This is the second sub item of the second item
<li> This is the third sub item of the second item
</ul>
<li>This is the third item
</ol>
Placing Lists in Your HTML Document
Using the list tags, you will now add an Ordered and an un-Ordered list to your Volcano Web page.
How many do you know?
<ul>
<li>caldera
<li>vesicularity
<li>pahoehoe
<li>rheology
<li>lahar
</ul>
Your mission is to find information and report on a volcano,
other than the ones listed above, that has erupted in the last
100 years. Your reports must include:
<ol>
<li>Type of volcano
<li>Geographic location
<li>Name, distance, and population of nearest major city
<li>Dates of most recent and most destructive eruptions.
<li>Other events associated with the recent eruptions
(earthquakes, floods, mudslides, etc)
</ol>
<p>
Then, write a one page description on the major hazards to humans
in the vicinity of this volcano. Speculate on what you would do
if you were in charge of minimizing the risk to the population.
Check Your Work
You may want to compare your document with a sample for this section. If your list is different than the list in the sample, review how you entered your list in your text editor. Make sure it matches the instructions in the Placing Lists in Your HTML Document section of this lesson.
Review Topics
Review topics for this lesson:
Independent Practice
You may want to experiment with changing the Ordered List you create to Unordered. Also, insert an Ordered or an Unordered list of items to your own WWW document. Be sure to verify that it displays correctly in your web browser. Can you create a list that includes sublists?
Coming Next....
Making it more than just plain text-- adding pictures to your page.
| Home | Next Lesson: Graphics a la Web. |
Copyright �1995-1999 by Michel Degr�ve ([email protected])