home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


HTML: The Definitive Guide

Previous Chapter 8
Formatted Lists
Next
 

8.4 Nesting Lists

Except inside directories or menus, lists nested inside other lists are fine. Menu and directory lists can be embedded within other lists.

Indents for each nested list are cumulative, so take care not to nest lists too much; the list contents could quickly turn into a thin ribbon of text flush against the right edge of the browser document window.

Nested Unordered Lists

The items in each nested unordered list may be preceded by a different bullet character at the discretion of the browser. For example, Internet Explorer Version 2 for the Macintosh uses an alternating series of hollow, solid circular, and square bullets for the various nests in the following source HTML text as shown in Figure 8.6:

<ul>
  <li>Morning Kumquat Delicacies
  <ul>
    <li>Hot Dishes
    <ul>
      <li>Kumquat omelet
      <li>Kumquat waffles
      <ul>
        <li>Country style
        <li>Belgian
      </ul>
      <li>Kumquats and toast
    </ul>
    <li>Cold Dishes
    <ul>
      <li>Kumquats and cornflakes
      <li>Pickled Kumquats
      <li>Diced Kumquats
    </ul>
  </ul>
</ul>

You can change the bullet style for each unordered list and even individual list items (see the type attribute discussion earlier in this chapter), but the repertoire of bullets is limited. For example, Internet Explorer for Windows 95 uses a solid disc regardless of the nesting level.

Nested Ordered Lists

By default, browsers number the items in ordered lists beginning with the Arabic numeral 1, nested or not. It would be great if the HTML standard numbered nested ordered lists in some rational, consecutive manner. For example, the items in the second nest of the third main ordered list might be successively numbered "3.2.1," "3.2.2," "3.2.3," and so on.

With the type and value attributes, however, you do have a lot more latitude in how you create nested ordered lists. An excellent example is the traditional style for outlining, which uses the many different ways of numbering items offered by the type attribute (see Figure 8.7):

<ol type=A>
  <li>A History of Kumquats
  <ol type=1>
    <li>Early History
    <ol type=a>
      <li>The Fossil Record
      <li>Kumquats: The Missing Link?
    </ol>
    <li>Mayan Use of Kumquats
    <li>Kumquats in the New World
  </ol>
  <li>Future Use of Kumquats
</ol>


Previous Home Next
The <li> Tag Book Index Directory Lists

HTML: The Definitive Guide CGI Programming JavaScript: The Definitive Guide Programming Perl WebMaster in a Nutshell