HTML <dir> Tag

The HTML <dir> tag is not supported in HTML5. It acts as a container for a list of files, folders, or directory contents. It is used with the <li> tags to display the list of directories in bullets. Instead of the HTML <dir> tag, the <ul> tag and CSS property can be used.


<dir>Directory List</dir>


<!DOCTYPE html>
<h4>Grocery List</h4>


In the above example, we created a Grocery List using the HTML <dir> tag.

Tag specific Attribute:

Attribute Uses
compact Used to define that the list should be displayed smaller than normal. Not supported in HTML5.

Supporting Browsers:

Chrome, IE, Firefox, Opera, and Safari.