HTML: The Definitive Guide

Previous Chapter 7 Next
 

7.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, Mosaic uses an alternating series of hollow and solid circular, square, and triangular bullets for the various nests in the following source HTML text as shown in Figure 7-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>

Netscape lets you change the bullet style for each unordered list and even individual list items (see the type attribute discussion earlier in this chapter), but the browser's repertoire of bullets is limited. Figure 7-7 shows what Netscape does with the nested unordered list example above.

Nested Ordered Lists

HTML 2.0 standard 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. Even the extended browsers don't do that.

With the extended browsers, however, you do have a lot more latitude in how you create nested ordered lists than the HTML 2.0 standard currently provides. An excellent example is the traditional style for outlining, which uses the many different ways of numbering items offered by the type attribute (Figure 7-8):

<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
 


Banner.Novgorod.Ru