You are here: >

HTML <dir> tag

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

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

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

    Compatibility

    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

    Also see: Browser, Compatibility, Optimized