HTML <dir>Tag -Not supported in HTML5


Examples

Directory list:

<dir> <li>html</li> <li>xhtml</li> <li>css</li> </dir>

Try it yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support the <dir> tag.


Tag Definition and Usage Instructions

HTML5 does not support the <dir> tag. Use CSS instead.

In HTML 4.01, the <dir> elementis deprecated。

The <dir> tag is used to define a directory list.


Tips and Notes

Tip:Please use CSS to style lists! In our CSS tutorial, you can find more details aboutstyling listsdetails.


Differences Between HTML 4.01 and HTML5

HTML5 does not support the <dir> tag, and HTML 4.01 has deprecated the <dir> tag.


Optional Attributes

Attribute Value Description
compact compact Not supported in HTML5. Deprecated in HTML 4.01.Specifies that the list should render one size smaller than normal.


Standard Attributes

In HTML 4.01, the <dir> tag supports the following standard attributes:

Attribute Value Description
class classname Specifies the class name of the element
dir rtl
ltr
Specifies the text direction of the content in the element
id id Specifies a unique id for the element
lang language_code Specifies the language code of the content in the element
style style_definition Specifies the inline style of the element
title text Specifies additional information about the element

For a full description, please visitStandard Attributes。


Event Attributes

In HTML 4.01, the <dir> tag supports the following event attributes:

Attribute Value Description
onclick script Script to be run when the mouse is clicked
ondblclick script Script to be run when the mouse is double-clicked
onmousedown script Script to be run when a mouse button is pressed down
onmousemove script Script to be run as the mouse pointer moves
onmouseout script Script to be run when the mouse pointer moves out of an element
onmouseover script Script to be run when the mouse pointer hovers over an element
onmouseup script Script to be run when a mouse button is released
onkeydown script Script to be run when a key is pressed
onkeypress script Script to be run when a key is pressed and released
onkeyup script Script to be run when a key is released

For a full description, please visitEvent Attributes。

Other Extensions