NOTICE: This website is no longer updated or supported - as such many of the techniques used to build it may seem antiquated in the modern day. It is preserved for historical reasons only.

HTML XHTML The Complete Reference
home » reference » appendix a » html element reference

<dir> (Directory List)

This element encloses a list of brief, unordered items, such as might occur in a menu or directory.

Syntax (Transitional Only)

accesskey="key" (5.5)
contenteditable="false | true | inherit" (5.5)
disabled="false | true" (5.5)
hidefocus="true | false" (5.5)
language="javascript | jscript | vbs | vbscript" (4)
tabindex="number" (5.5)
unselectable="on | off" (5.5)

Standard Events (Deprecated)

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

Events Defined by Internet Explorer

onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onblur, oncontextmenu, oncontrolselect, oncopy, oncut, ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocus, onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresizeend, onresizestart, onselectstart, ontimeerror

Element Specific Attributes

This attribute reduces the white space between list items.


   <li>Header Files
   <li>Code Files
   <li>Comment Files


HTML 2, 3.2, 4, and 4.01 (transitional), XHTML 1.0 (transitional)
Internet Explorer 2, 3, 4, 5, 5.5, 6
Netscape 1, 2, 3, 4- 4.7, 6, 7
Opera 4-7


Because the <dir> tag is supposed to be used with short lists, the items in the list should have a maximum width of 20 characters. This is rarely respected.

The HTML and XHTML strict specifications do not support this element.

Most browsers will not render the <dir> tag any differently from the ul element.

HTML 2 and 3.2 define only the compact attribute.

Most browsers will not render the compact list style.

For XHTML compatibility, the compact attribute must have a value:
<dir compact="compact">.

(X)HTML Elements
CSS Properties
Previous: dfn Next: div
< Home | About | Chapters | Examples | Errata | Reference | Site Map >