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

DIR - unnumbered list in directory-like form


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

<LI> list item 1
<LI> list item 2

Possible attributes

attribute name possible values meaning
COMPACT COMPACT reduced interim spacing

Typically, browsers ignore the COMPACT attribute.

Allowed context

Block container.


LI elements which do not contain block elements.


A very small list:

Example DIR-1.html:

A larger list of very small elements (typically this is not rendered in a suitable manner):

Example DIR-2.html:

See also Examples of various list elements in HTML.


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.