HTML <dir> tag

Updated: 12/29/2017 by Computer Hope

HTML dir tagWhen 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.

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

Example code


Example result

  • fileone.html
  • filetwo.html
  • filethree.html
  • Old 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 typically would


    Internet Explorer Firefox Safari Opera Chrome
    All versions * All versions * All version * All versions * All versions *

    *Until it is removed in a future version of HTML

    Browser, Compatibility, Optimized, Web design terms