Learning HTML 3.2 by Examples, section 5 Descriptions of HTML 3.2 tags:

DIR - unnumbered list in directory-like form

Purpose

To present information in a directory-like format. The HTML 2.0 specification says that DIR represents a list of short items, typically up to 20 characters each.

Typical rendering

In practise, most browsers present a DIR element exactly the same way as an UL element. A few browsers omit the bullets, however.

Theoretically, the recommendation has been and still is that DIR element be rendered as a multicolumn directory list.

Basic syntax

<DIR>
<LI> list item 1
<LI> list item 2
...
</DIR>

Possible attributes

attribute name possible values meaning
COMPACT COMPACT reduced interim spacing

Typically, browsers ignore the COMPACT attribute.

Allowed context

Block container.

Contents

LI elements which do not contain block elements.

Examples

A very small list:

Example DIR-1.html:

<DIR>
<LI>one
<LI>two
<LI>three
</DIR>
A larger list of very small elements (typically this is not rendered in a suitable manner):

Example DIR-2.html:

<DIR>
<LI>A<LI>B<LI>C<LI>D<LI>E<LI>F<LI>G<LI>H<LI>I<LI>J<LI>K<LI>L<LI>M
<LI>N<LI>O<LI>P<LI>Q<LI>R<LI>S<LI>T<LI>U<LI>V<LI>W<LI>X<LI>Y<LI>Z
</DIR>
See also Examples of various list elements in HTML.

Notes

In HTML 4.0, the DIR element is deprecated in favor of the UL element; style sheets can be used to suggest features of the presentation of a list.

See general notes about list elements for a discussion of selecting between them.



Date of last update: 2010-12-16.
This page belongs to the free information site IT and communication, section Web authoring and surfing, by Jukka "Yucca" Korpela.