Skip to content
Tutorials Center
My learning

Topics

HTML Reference ยท Obsolete Elements

The <dir> element (obsolete)

The HTML <dir> element marked up directory listings and is obsolete. Learn how browsers render it today and how to replace it with an unordered list.

The <dir> element was intended for directory listings: short lists of items, such as file names, that browsers might lay out in columns. Each entry was an <li>.

Why it's obsolete

Browsers never gave <dir> any special layout; it always looked exactly like an unordered list. With no real difference from <ul>, it was deprecated in HTML 4 and made obsolete in HTML5.

Browsers still render it, as a bulleted list identical to <ul>.

Modern replacement

Rename the tag to <ul>. If you want the items in columns, add CSS.

dir before, ul after

Do not confuse the element with the global dir attribute, which is current HTML and sets text direction (ltr, rtl or auto).

Technical summary

Status Obsolete (non-conforming)
Replacement <ul>
Still rendered by browsers Yes, like an unordered list