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.1.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.
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 used the <code> tag to ensure that the filenames would be rendered in an appropriate ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access