HTML - <dir> Tag



The HTML <dir> tag is used for specifying a directory list. This is very similar to <ul> tag.

The <dir> tag is no longer recommended as it is deprecated and not supported in HTML5. Instead of using this tag, we can use the <ul> tag and CSS properties.

Example

In the following example, we are going to use the dir tag and checking for the output.

<!DOCTYPE html>
<html>
<head>
   <title>HTML dir Tag</title>
</head>
<body>
   <dir>
      <li>dir</li>
      <li>menu</li>
      <li>ul</li>
   </dir>
</body>
</html>

On running the above code, the output window will pop up, displaying the text on the webpage.

Global Attributes

This tag supports all the global attributes described in HTML Attribute Reference

Specific Attributes

The HTML <dir> tag also supports the following additional attributes −

Attribute Value Description
compact compact Deprecated − Specifies a compact rendering.

Event Attributes

This tag supports all the event attributes described in HTML Events Reference

html_deprecated_tags.htm
Advertisements