<dir>


HTML <dir> Tags - HTML5 Not supported

##Instance

<!DOCTYPE html>
<html>
<body>

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

</body>
</html>

Run instance»Click the "Run instance" button to view the online instance


Browser support

1000.png ##All major browsers support the <dir> tag.

Tag definition and usage instructions

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

In HTML 4.01, the <dir> element is deprecated.

<dir> tag is used to define directory listings.

Tips and Notes

Tips:

Please use CSS to style the list! You can find more details on styling lists in our CSS tutorial.

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

AttributescompactHTML5 Not supported. HTML 4.01 is deprecated.
ValueDescription
compact Specifies that the list must be presented one size smaller than the normal state.

Standard attributes

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

Attributesclassclassnamedir ltrididlanglanguage_codestylestyle_definitiontitletext

For a complete description, please visit the standard properties.


Event attributes

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

ValueDescription
Specifies the class name of the element
rtl
Specifies the text direction of the content in the element
Specifies the uniqueness of the element id
Specifies the language code of the content in the element
Specifies the inline style of the element
Specifies additional information for elements
## onkeypressExecute script when the keyboard is pressed and then releasedonkeyupExecute script when the keyboard is released
AttributesValueDescription
onclickscriptWhen the mouse is clicked Execute script
ondblclickscriptExecute script when the mouse is double-clicked
onmousedownscriptExecute script when mouse button is pressed
onmousemovescriptExecute script when mouse pointer moves
onmouseoutscript Execute the script when the mouse pointer moves out of an element
onmouseoverscriptWhen the mouse pointer hovers over Execute the script when on an element
onmouseupscriptExecute the script when the mouse button is released
onkeydownscriptExecute script when the keyboard is pressed
#script
script
For a complete description, please visit the event properties.