dd tag in html with examples






  1. The HTML <dd> tag is used for specifying a definition description in a definition list.
  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. Inside a <dd> tag you can put paragraphs, line breaks, images, links, lists,etc.
  4. The <dd> tag is supported in all major browsers.


Example :

     <html>
     <head>
     <title>DD</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 used dd tag to render list.



dd and Style :



<html>
<head>
<title>DDStyle</title>
<style type="text/css">
dd
{
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 :





In the above example, we have applied style to dd elements using element selector.

0 comments:

Post a Comment