HTML dir Tag

HTML <dir> tag was used as a container for the list of files/folders or content of the directory. The <dir> element is used with the <li> tags, and list of directories renders in bullets by default.

Note: Do not use HTML <dir> tag as it is deprecated now and not supported in HTML5. You can use <ul> tag and CSS property instead.

Syntax

Example

<dir>Directory list... </dir>

Here are some details regarding the HTML <dir> element:

Display Block
Start tag/End tag Both Start and End tag
Usage HTML lists

Example 1

Example

<!DOCTYPE html>

<html>

<head>

	<title>Dir tag</title>

	<style>

		h2{

		    color: #b22222;}

		p{

		   color: green;}

	</style>

 </head>

<body>

  <h2>Example of dir tag</h2>

  <p>List of our site popular Tutorials</p>

    <dir>

	<li>Java-tutorial</li>

	<li>DBMS-tutorial</li>

	<li>DataStructure-tutorial</li>

	<li>HTML-tutorial</li>

   </dir>

 </body>

</html>

Output:

Attribute

Tag-specific Attribute

Attribute Value Description
compact compact It specifies that list should display smaller than normal. (Not supported in HTML5)

Global Attribute

HTML <dir> element is compatible with the Global attributes.

Event Attribute

HTML <dir> element accommodates the Event attributes.

Supporting Browsers

Element Chrome IE Firefox Opera Safari
<dir> Yes Yes Yes Yes Yes

Input Required

This code uses input(). Please provide values below: