element was originally intended to be used specifically to display
directory lists, rather than to act as a generic list in which
any content could be placed. Like the
ul list types, the
dir element contains a series of
li is a block-level element, which would normally
be able to contain other block-level elements, when it’s used in the
context of a
dir, a child
can only contain inline elements.
The listing below shows a directory of plants:
<dir> <li>shrubs</li> <li>conifers</li> <li>hedges</li> </dir>
Use This for…
element is used for series of directory titles.
dir element is used, most browsers will simply render
the list exactly as they would a
ul and series of
li elements. As such, you’re better simply to use those
elements instead, and thus ensure forwards and backwards compatibility,
cross-browser support, and validity.