HTML <dir> Tag
The dir element is deprecated.
Example
A directory list:
<dir>
<li>html</li>
<li>xhtml</li>
<li>css</li>
</dir> |
Try it yourself » |
Definition and Usage
The <dir> tag is used to list directory titles.
Browser Support

The <dir> tag is supported in all major browsers.
Differences Between HTML and XHTML
NONE
Tips and Notes
Tip: Use CSS to style lists! In our CSS tutorial you can find more details about styling lists.
Optional Attributes
DTD indicates in which HTML 4.01/XHTML 1.0
DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
| Attribute |
Value |
Description |
DTD |
| compact |
compact |
Deprecated. Use styles instead.
Specifies that the list should render smaller than normal |
TF |
Standard Attributes
The <dir> tag supports the following standard attributes:
| Attribute |
Value |
Description |
DTD |
| class |
classname |
Specifies a classname for an element |
TF |
| dir |
rtl
ltr |
Specifies the text direction
for the content in an element |
TF |
| id |
id |
Specifies a unique id for an element |
TF |
| lang |
language_code |
Specifies a language code for the content in an element |
TF |
| style |
style_definition |
Specifies an inline style for an element |
TF |
| title |
text |
Specifies extra information about an element |
TF |
More information about Standard Attributes.
Event Attributes
The <dir> tag supports the following event attributes:
| Attribute |
Value |
Description |
DTD |
| onclick |
script |
Script to be run on a mouse click |
TF |
| ondblclick |
script |
Script to be run on a mouse double-click |
TF |
| onmousedown |
script |
Script to be run when mouse button is pressed |
TF |
| onmousemove |
script |
Script to be run when mouse pointer moves |
TF |
| onmouseout |
script |
Script to be run when mouse pointer moves out of an
element |
TF |
| onmouseover |
script |
Script to be run when mouse pointer moves over an
element |
TF |
| onmouseup |
script |
Script to be run when mouse button is released |
TF |
| onkeydown |
script |
Script to be run when a key is pressed |
TF |
| onkeypress |
script |
Script to be run when a key is pressed and released |
TF |
| onkeyup |
script |
Script to be run when a key is released |
TF |
More information about Event Attributes.
Create a free Flash website with our simple, online web design editing platform. Stunning templates
and user-friendly tools make website building easy and fun.
Start Creating your free website now!

The Altova MissionKit is an integrated suite of tools ideal for:
- XML development
- Web & Web services development
- Data mapping & integration
- Rendering & publishing XML & database data
- XBRL validation, taxonomy editing, transformation & rendering
The MissionKit for XML Developers includes XMLSpy® - the industry-leading XML editor; MapForce® - a
graphical data mapping, conversion, and integration tool; StyleVision® - a visual XSLT stylesheet designer;
DiffDog® - an XML-aware diff/merge tool; and 2 additional tools.
Try all 6 products free for 30 days!
Download a fully-functional free trial
|
|
|
|