HTML <dir> tag

Updated: 11/13/2018 by Computer Hope
HTML dir tag

When writing in HTML (hypertext markup language), the <dir> tag was a block element used to designate a collection of file names. It functioned very similarly to the <ul> and <ol> tags. The following sections contain information about the <dir> tag, including an example of it in use, and related attributes and browser compatibility.

Note

The <dir> tag is no longer supported; CSS (cascading style sheets) should be used instead.

Example of <dir> code

<dir>
<li>fileone.html</li>
<li>filetwo.html</li>
<li>filethree.html</li>
</dir>

Example result

  • fileone.html
  • filetwo.html
  • filethree.html
  • Attributes

    All HTML tags support standard attributes that define the settings of an HTML element. In addition to the standard settings, the <dir> tag has the following unique attributes.

    Attribute Description
    compact Designates that the list should display smaller than it normally would.

    Compatibility

    Internet Explorer Firefox Safari Opera Chrome
    Not supported Not supported Not supported Not supported Not supported

    Browser, Compatibility, Container tag, Optimized, Web design terms