HTML <dir> Tag

The <dir> tag is used to define a list of directory titles. The items inside the list are defined using the <li> tag (as with HTML lists that are defined using <ol> and <ul> tags). The list of directory titles are marked with bullets by default.

Syntax

The <dir> tag comes in pairs; the content is written between opening (<dir>) and closing (</dir>) tags.

The <dir> tag is not supported in HTML5. Use the <ul> tag and CSS list-style property (see examples below).

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <body>
    <dir>
      <li>HTML Tutorial</li>
      <li> CSS Tutorial</li>
      <li>PHP Tutorial</li>
    </dir>
  </body>
</html>

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <body>
    <head>
      <style>
        ul { 
          list-style:disc; 
        }
      </style>
    </head>
    <ul>
      <li>HTML Tutorial</li>
      <li> CSS Tutorial</li>
      <li>PHP Tutorial</li>
    </ul>
  </body>
</html>

Attributes

Attribute Value Description
compact compact Specifies that the list should render smaller than normal.
Not supported in HTML5.

The <dir> tag also supports the Global Attributes.