HTML » Tags » dir

Version: 2.0, 3.2

Compability: Explorer 4, 5  Netscape 4, 6

Syntax:
<dir> ... </dir>

The <dir> element is deprecated in HTML 4.01.

The dir tag is used to create a directory list of computer files and programs. The concept was that the items in the list were expected to be file and program names which fit on a single line, rather than large blocks of text. The <dir> tag is officially deprecated effective with HTML 4.0. Instead, you are now to use the unordered list ul tag. However, this tag remains in minor use on the Internet and is still recognized by all major browsers.

In fact, this tag is simply a specialized unordered list. The dir tag must be used with the li tag which places a bullet before each line of text just like it does for the ul tag. You can create a nested (indented) directory list by placing dir tags between another opening and closing pair of dir tags. In some browsers, the bullet becomes a circle for the nested list.
 
In most browsers, a paragraph break occurs before and after the list.
 
The closing tag is mandatory.
 

Examples

Code:
DevGuru Directory:
<dir>
<li> html_lists
<dir>
<li> html_li.html
<li> html_ol.html
<li> html_ul.html
</dir>
<li> html_events
<dir>
<li> html_onclick.html
<li> html_ondblclick.html
</dir>
</dir>
Output:
DevGuru Directory:
  • html_lists
    • html_li.html
    • html_ol.html
    • html_ul.html
  • html_events
    • html_onclick.html
    • html_ondblclick.html
Language(s): HTML

See Also: