HTML <dir> tag (deprecated)S2C Home   « HTML <dir> tag

Definition

The <dir> tag is used for defining a directory list.

Use the <dl></dl>, <ol></ol> or <ul></ul> elements to define the type of list you want and use CSS to style it.

Example


<dir>
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
  <li>Four</li>
</dir>

Required Attributes

NONE

Optional Attributes

compact - this attribute is deprecated, use CSS instead.

Common Attributes

class - specifies a classname for the element allowing you to apply the style of the predefined class to the content.


<dir class="classname">Some text here</dir>

id - specifies a unique id for the element allowing you to apply the style of the predefined id to the content.


<dir id="idname">Some text here</dir>

style - specifies an inline style for the element allowing you to apply the style to the content.


<dir style="color:red;text-align:left">Some text here</dir>

title - specifies extra information about the content.


<dir title="information about the content">Some text here</dir>

Language Attributes

dir - specifies the directional flow of the content.


<!-- The text will flow from left to right -->
<dir dir="ltr">Some text here</dir>

<!-- The text will flow from right to left -->
<dir dir="rtl">Some text here</dir>

lang - specifies a language code for the content of the element.


<dir lang="en">Some text here</dir>

Document Event Attributes

NONE

Form Event Attributes

NONE

Image Event Attributes

NONE

Keyboard Event Attributes

onkeydown - The JavaScript code to be run when an element is in focus and keyboard key is pressed.


<!-- Executes the go() function -->
<dir onkeydown="go()">Some text here</dir>

onkeypress - The JavaScript code to be run when an element is in focus and keyboard key is pressed down and released.


<!-- Executes the go() function -->
<dir onkeypress="go()">Some text here</dir>

onkeyup - The JavaScript code to be run when an element is in focus and keyboard key is released.


<!-- Executes the go() function -->
<dir onkeyup="go()">Some text here</dir>

Mouse Event Attributes

onclick - The JavaScript code to be run when a mouse is clicked on the element.


<!-- Executes the go() function -->
<dir onclick="go()">Some text here</dir>

ondblclick - The JavaScript code to be run when a mouse is double clicked on the element.


<!-- Executes the go() function -->
<dir ondblclick="go()">Some text here</dir>

onmousedown - The JavaScript code to be run when the mouse button is pressed down while the cursor is over the element.


<!-- Executes the go() function -->
<dir onmousedown="go()">Some text here</dir>

onmousemove - The JavaScript code to be run when the mouse button is moved.


<!-- Executes the go() function -->
<dir onmousemove="go()">Some text here</dir>

onmouseout - The JavaScript code to be run when the mouse cursor moves off an element.


<!-- Executes the go() function -->
<dir onmouseout="go()">Some text here</dir>

onmouseover - The JavaScript code to be run when the mouse cursor moves over an element.


<!-- Executes the go() function -->
<dir onmouseover="go()">Some text here</dir>

onmouseup - The JavaScript code to be run when the mouse button is released while the cursor is over the element.


<!-- Executes the go() function -->
<dir onmouseup="go()">Some text here</dir>

go to home page Homepage go to top of page Top