HTML: The Definitive Guide

Previous Chapter 7 Next
 

7.6 Menu Lists

The HTML menu list is yet another specialized form of the unordered list.

The <menu> Tag

The <menu> tag displays a list of short choices to the reader, such as a menu of links to other documents. The browser may use a special (typically more compact) representation of items in a menu list compared with the general unordered list, or even use some sort of graphical pulldown menu to implement the menu list. If the list items are short enough, the browser may even display them in a multicolumn format, and may not append a leading bullet with each list item.

Like an unordered list, the menu list items are defined with the <li> tag. When used within a menu list, however, the <li> tag may not contain any block element, including paragraphs, other lists, preformatted text, or forms.

Compare the source text below and the Mosaic display (Figure 7-10) with the directory (Figure 7-9) and unordered (Figure 7-1) list displays we presented earlier in this chapter.

<p>
Some popular kumquat recipes include:
<menu>
  <li>Pickled Kumquats
  <li>'Quats and 'Kraut (a holiday favorite!)
  <li>'Quatshakes
</menu>
There are many more to please every palate!

The <menu> tag also has the compact attribute to produce an even more reduced list presentation, although in practice, few browsers are willing or able to implement the compacted menu list display. Netscape, in fact, doesn't distinguish between a menu and an unordered list.

You can change the style Netscape uses to bullet the <menu> list items with the type attribute extension and the values circle, square, or disc. This behavior is identical to that of the type attribute in an unordered list.


Previous Home Next
Directory Lists Book Index Definition Lists