The Wayback Machine - https://web.archive.org/web/20240407023124/https://www.geeksforgeeks.org/html-description-lists/
Open In App

HTML Description Lists

Improve
Improve
Like Article
Like
Save
Share
Report

HTML Description List displays the elements in the form of a definition and represents the description list using the <dl> tag. This tag contains the <dt> and <dd> tags.

Syntax

<dl>
<dt>Course</dt>
<dd>DSA</dd>
<dt>Language</dt>
<dd>Python</dd>
</dl>

Description Lists Tags

Tags

Descriptions

<dl>

This tag defines the description list.

<dt>

This tag defines the data terms inside the list.

<dd>

This tag defines the description of data.

HTML Description Lists Examples

Below are some examples of the description lists in HTML.

Example 1: In this example the HTML <dl> tag is used to define description lists. It contains one or more pairs of <dt> (term) and <dd> (description) elements, like “GeeksforGeeks: A Computer Science Portal for Geeks.

HTML
<!DOCTYPE html>
<html>
    <body>
        <h2>dl Tag</h2>

        <!-- HTML dl tag -->
        <dl>
            <dt>GeeksforGeeks</dt>
            <dd>
                A Computer Science Portal For
                Geeks
            </dd>
        </dl>
    </body>
</html>

Output: 

HTMLdlTag

HTML Description Lists Example output

Example 2: In This example we represents a description list with one term (“GeeksforGeeks”) and two descriptions. The second description contains a nested description list with terms (“Courses”) and their corresponding descriptions.

HTML
<!DOCTYPE html>
<html>
    <body>
        <h3>HTML Description Lists</h3>

        <dl>
            <dt>GeeksforGeeks</dt>
            <dd>
                A Computer Science Portal For
                Geeks
            </dd>
            <dd>
                <dl>
                    <dt>Courses</dt>
                    <dd>Programming</dd>
                    <dd>Web Tech</dd>
                    <dd>Reasoning</dd>
                    <dd>DSA</dd>
                </dl>
            </dd>
        </dl>
    </body>
</html>

Output:

HTMLDescriptionList

HTML Description Lists Example Output


Last Updated : 12 Mar, 2024
Like Article
Save Article
Previous
Next
Share your thoughts in the comments

Similar Reads