dir tag in html with examples






  1. The <dir> tag is used to create a directory list of computer files and programs.
  2. The <dir> tag is officially deprecated effective with HTML 4.0.
  3. Instead, you are now to use the unordered list ul tag.
  4. The dir tag is used to create a directory list of computer files and programs.
  5. The dir tag must be used with the <li> tag which places a bullet before each line of text just like it does for the <ul> tag. You can create a nested (indented) directory list by placing <dir> tags between another opening and closing pair of <dir> tags.
  6. In some browsers, the bullet becomes a circle for the nested list. 
  7. The <dir> tag is supported in all major browsers.


Example :

     <html>
     <head>
     <title>Dir</title>
     </head>
     <body>
     <dir>
     <li> html_lists</li>
     <dir>
     <li> kk.html</li>
     <li> hh.html</li>
     <li> ps.html</li>
     </dir>
     <li> html_events
     <dir>
     <li> td_onclick.html</li>
     <li> rt_ondblclick.html</li>
     </dir>
     </dir>
     </body>
     </html>
     

Demo :





In the above example, we have rendered dir element.



dir and Style :



<html>
<head>
<title>DirStyle</title>
<style type="text/css">
dir
{
font-family:comic sans ms;
color:green;
background-image:url("p1.jpg");
}
</style>
</head>
<body>
<dir>
<li> html_lists
<dir>
<li> kk.html
<li> hh.html
<li> ps.html
</dir>
<li> html_events
<dir>
<li> td_onclick.html
<li> rt_ondblclick.html
</dir>
</dir>
</body>
</html>


Demo :





In the above example, we have applied CSS to die element.



0 comments:

Post a Comment