HTML Tutorial: The <dir>
Tag
The <dir>
tag was used in older versions of HTML to define a directory list. However, it is now obsolete and no longer supported in HTML5. It is recommended to use CSS for styling instead.
Attributes of the <dir>
Tag:
Attribute | Description |
---|---|
compact |
Specifies whether the list should be compacted |
type |
Specifies the bullet style of the list items |
Example:
<dir compact>
<li>File 1.txt</li>
<li>File 2.png</li>
<li>File 3.jpg</li>
</dir>
In the example above, the <dir>
tag is used to create a compact directory list with three file names. Each file name is wrapped in a <dir>
tag to create list items within the directory.