Summary -

In this topic, we described about the <dir> tag along with detailed example.

The <dir> tag is not supported in HTML5. Used to list the directory titles. Directory titles use <dir> tag to represent.

Syntax -

<dir>.. text here.. </dir>

Example -

<!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>

Output -

  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday

  • Note! Use CSS instead of dir element which is not supported in HTML5.