dl tag in html with examples






  1. The <dl> tag defines a definition list. A list is composed by terms (HTML dt tag) and descriptions (HTML dd tag). 
  2. A definition list is similar to other lists but in a definition list, each list item contains two entries; a term and a description.
  3. The <dl> tag is supported in all major browsers.


Example :

     <html>
     <head>
     <title>DL</title>
     </head>
     <body>
     <dl>
     <dt>Fruits</dt>
     <dd>Mango</dd>
     <dd>Grapes</dd>
     <dt>Vegetables</dt>
     <dd>Potato</dd>
     <dd>Tomato</dd>
     </dl>
     </body>
     </html>
     

Demo :





In the above example, we have render the dl element.



dl and style :




<html>
<head>
<title>DLStyle</title>
<style type="text/css">
dl
{
font-family:comic sans ms;
color:green;
width:400px;
text-align:center;
}
</style>
</head>
<body>
<dl>
<dt>Fruits</dt>
<dd>Mango</dd>
<dd>Grapes</dd>
<dt>Vegetables</dt>
<dd>Potato</dd>
<dd>Tomato</dd>
</dl>
</body>
</html>


Demo :



0 comments:

Post a Comment