HTML Dir Tag
The <dir> tag stands for “directory”, and it was originally used in older versions of HTML to create a list of directory or folder names. It looked very similar to a regular unordered list (<ul>), but the idea was that it represented a list of files or directories, like what you’d see in a file browser.
However, it's important to know that the <dir> tag is deprecated, meaning it's no longer recommended for use in modern websites. Today, developers usually use the <ul> (unordered list) or <ol> (ordered list) tags instead. Still, it's good to know what the <dir> tag was meant for, especially if you’re working with older HTML code or maintaining legacy systems.
Syntax -
<dir>
<li>Documents</li>
<li>Downloads</li>
<li>Pictures</li>
</dir>
In this code: <dir> creates the container for the list. <li> stands for "list item" and each item inside the directory list is wrapped in this tag.
Example -
Scenario1 - Directory List Using <dir>
<!DOCTYPE html>
<html>
<head>
<title>dir tag text example..</title>
</head>
<body>
<dir>
<li>Monday</li>
<li>Tuesday</li>
<li>Wednesday</li>
<li>Thursday</li>
<li>Friday</li>
<li>Saturday</li>
<li>Sunday</li>
</dir>
</body>
</html>