HTML dir Tag

HTML <dir> Tag: The HTML<dir> tag specifies a list of directory files. It is not supported in HTML 5 so ul or CSS are used instead of HTML  dir  tag.

HTML <dir> Tag

Browser compatibility

The HTML<dir> tag is supported by different types of browsers.

  • Chrome,
  • Firefox
  • Opera,
  • Safari
  • Internet Explorer.

Example:

<!DOCTYPE html>
<html>
<body>
<dir>
  <li>html</li&gt;
  <li>xhtml</li>
  <li>css</li>
</dir>
</body>
</html>

Output:

html dir tag

Attributes that are supported by the <dir> tag

Attribute Value Description
compact compact Describes that the list should render smaller than normal