HTML <dir> tag

Deprecated dir element!


Directory listing:


Try it yourself

Browser Support

IE Firefox Chrome Safari Opera

All major browsers support <dir> tag.

Definition and Usage

<Dir> tag defines the directory listing.

Differences between HTML and XHTML

In HTML 4.01, dir element is not in favor of use.

In XHTML 1.0 Strict DTD in, dir element is not supported.

Tips and Notes:

Tip: Use CSS styles to add to the list! In our CSS tutorial you can find more information about adding styles to the list of details.

Optional attributes

Attributes value description
compact compact

Deprecated. Use styles instead.

Standard property

id, class, title, style, dir, lang, xml:lang

For a full description, go to Standard property .

Event Properties

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

For a full description, go to Event Attributes .