HTML The Definitive Guide (86 page)

Read HTML The Definitive Guide Online

Authors: Chuck Musciano Bill Kennedy

BOOK: HTML The Definitive Guide
5.29Mb size Format: txt, pdf, ePub

Chapter 8

Formatted Lists

 

8.6 Menu Lists

The HTML menu list is yet another specialized form of the unordered list. It, too, like

is deprecated in the HTML 4.0 standard, so we don't recommend using it.
[
    , 8.1]

    8.6.1 The

    Tag (Deprecated)
    The 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.


    Function:

    Define a menu list

    Attributes:

    CLASS ONKEYUP

    DIR ONMOUSEDOWN

    ID ONMOUSEMOVE

    LANG ONMOUSEOUT

    ONCLICK ONMOUSEOVER

    ONDBLCLICK ONMOUSEUP

    ONKEYDOWN STYLE

    ONKEYPRESS TITLE

    End tag:

    ; never omitted

    Contains:

    list_content

    Used in:

    block

    Like an unordered list, define the menu list items with the

  • tag. When used within a menu list, however, the
  • 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 8.9) with the directory (Figure 8.8
    ) and
    unordered (Figure 8.1) list displays we presented earlier in this chapter:


    Some popular kumquat recipes include:


  • Pickled Kumquats

  • 'Quats and 'Kraut (a holiday favorite!)
  • 'Quatshakes


  • There are many more to please every palate!

    Figure 8.9: Sample

    list

    8.5 Directory Lists

    8.7 Definition Lists

    Chapter 8

    Formatted Lists

     

    8.7 Definition Lists

    HTML also supports a list style entirely different from the ordered and unordered lists we've discussed so far: definition lists. Like the entries you find in a dictionary or encyclopedia, complete with text, pictures, and other multimedia elements, the definition list is the ideal way to present a glossary, list of terms, or other name/value lists in HTML.

    8.7.1 The

    Tag

    The definition list is enclosed by the

    and
    tags. Within those tags, each item in a definition list is composed of two parts: a term followed by its definition or explanation. Instead of
  • , each item name in a
    list is marked with the
    tag, followed by the item's definition or explanation as marked by the
    tag.


    Function:

    Define a definition list

    Attributes:

    CLASS ONKEYUP

    COMPACT ONMOUSEDOWN

    DIR ONMOUSEMOVE

    ID ONMOUSEOUT

    LANG ONMOUSEOVER

    ONCLICK ONMOUSEUP

    ONDBLCLICK STYLE

    ONKEYDOWN TITLE

    ONKEYPRESS

    End tag:

    ; never omitted

    Contains:

    dl_content

    Used in:

    block

    Unless you change the display attributes with style sheet rules, browsers typically render the item or term name at the left margin and render the definition or explanation below it and indented. If the definition terms are very short (typically less than three characters), the browser may choose to place the first portion of the definition on the same line as the term. See how the source HTML definition
    list below gets displayed by Netscape in Figure 8.10
    : Common Kumquat Parasites


Other books

Masquerade by Amanda Ashley - Masquerade
Being Dead by Vivian Vande Velde
Two Halves Series by Marta Szemik
Valerie French (1923) by Dornford Yates
An Order for Death by Susanna Gregory
Bittersweet Summer by Anne Warren Smith
Unlocking Adeline (Skeleton Key) by J.D. Hollyfield, Skeleton Key
The Boy on the Porch by Sharon Creech