Team LiB   Previous Section   Next Section

7.7 Directory Lists

The directory list is a specialized form of unordered list. It has been deprecated in the HTML 4 and XHTML standards. We don't recommend that you use it at all. [<ul>]

7.7.1 The <dir> Tag (Deprecated)

The designers of HTML originally dedicated the <dir> tag for displaying lists of files. As such, the browser, if it treats <dir> and <ul> differently at all (most don't), expects the various list elements to be quite short, possibly no longer than 20 or so characters. Some browsers display the elements in a multicolumn format and may not use a leading bullet.

<dir>

Function

Defines a directory list

Attributes

class, dir, id, lang, onClick, onDblClick, onKeyDown, onKeyPress, onKeyUp, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp, style, title

End tag

</dir>; never omitted

Contains

list_content

Used in

block

As with an unordered list, you define directory list items with the <li> tag. When used within a directory list, however, the <li> tag may not contain any block element, including paragraphs, other lists, preformatted text, or forms.

The following example puts the directory tag to its traditional task of presenting a list of filenames:

The distribution tape has the following files on it:
<dir>
  <li><code>README</code></li>
  <li><code>Makefile</code></li>
  <li><code>main.c</code></li>
  <li><code>config.h</code></li>
  <li><code>util.c</code></li>
</dir>

Notice that we use the <code> tag to ensure that the filenames would be rendered in an appropriate manner (see Figure 7-9, as rendered by the now ancient Mosaic browser).

Figure 7-9. An example <dir> list
figs/htm5_0709.gif
7.7.1.1 The <dir> attributes

The attributes for the <dir> tag are identical to those for <ul>, with the same effects.

    Team LiB   Previous Section   Next Section