HTML Description Lists

 HTML Description Lists

HTML Description Lists are commonly used to implement a glossary or to display metadata (a list of key-value pairs).

It somehow affects Search Engine Optimization (SEO).

HTML Description Lists

  • <dl> : defines a description list. It enclose a group of terms.
  • <dt> : enclosed by the <dl> element it defines a description term
  • <dd> : enclosed by the <dl> element it defines a description details.

Example:

<!doctype html>
<html>
    <head>
        <title> Styling Lists </title>
    </head>
    <body>
        <dl>
            <dt>dog</dt>
            <dd> a domisticated meat-eating mammal. </dd>

            <dt> cat </dt>
            <dd> a small furry mammal kept as a pet. </dd>

            <dt> mouse </dt>
            <dd> a samll rodent with a long tail. </dd>
        </dl>
    </body>
</html>

Output:

Styling Description  Lists Example:

<!doctype html>
<html>
    <head>
        <title> Style Description Lists </title>
        <style>
            dt{
                font-weight: bold;
                text-decoration: underline;
            }
            dd{
                font-style: italic;
            }
        </style>
    </head>
    <body>
        <dl>
            <dt>dog</dt>
            <dd> a domisticated meat-eating mammal. </dd>

            <dt> cat </dt>
            <dd> a small furry mammal kept as a pet. </dd>

            < dt> mouse </dt>
            <dd> a samll rodent with a long tail. </dd>
        </dl>
    </body>
</html>

Output:




    
                                                                                

Post a Comment

Post a Comment (0)