HTML <dir> tag

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

When writing in HTML, 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, as well as related attributes and browser compatibility.


The <dir> tag is no longer supported; CSS should be used instead.

Example of <dir> code


Example result

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

    Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The <dir> tag is deprecated, but at one time it utilized the unique attribute contained in the following table.

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


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

    Browser, Compatibility, Optimized, Web design terms