Table of contents
1.
Introduction
2.
Definition & Usage
3.
Syntax
4.
Examples
4.1.
Example 1: Basic Usage of <dt> Tag
4.2.
Example 2: Using <dt> with Multiple Definitions
5.
Supported Browsers
5.1.
Browser Support
6.
Frequently Asked Questions
6.1.
What is the purpose of the <dt> tag in HTML?
6.2.
Can a <dt> tag have multiple <dd> tags?
6.3.
Is the <dt> tag necessary in a description list?
7.
Conclusion
Last Updated: Feb 23, 2025
Medium

HTML dt tag

Author Pallavi singh
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

The <dt> tag in HTML is used inside a description list (<dl>) to define a term or name in the list. It is followed by a <dd> tag, which provides the description or definition of the term. This tag is commonly used for glossaries, metadata, and key-value pairs. 

HTML dt tag

In this article, you will learn about the syntax, usage, and examples of the <dt> tag in HTML.

Definition & Usage

The `<dt>` tag in HTML stands for "definition term." It is used inside a definition list, which is created using the `<dl>` tag. A definition list is a way to display terms & their corresponding descriptions or explanations. The `<dt>` tag specifies the term, while the `<dd>` tag is used to provide the description or definition of that term. This structure helps organize content in a clear & logical manner.

For example, if you are creating a glossary of technical terms or explaining key concepts, the `<dt>` tag can be very helpful. It ensures that the term & its explanation are grouped together, making it easier for users to follow.

Let’s discuss an example of how the `<dt>` tag is used in a complete HTML code:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Definition List Example</title>
</head>
<body>
    <h1>Glossary of Terms</h1>
    <dl>
        <dt>HTML</dt>
        <dd>HyperText Markup Language is the standard language used to create web pages.</dd>

        <dt>CSS</dt>
        <dd>Cascading Style Sheets is used to style & format the layout of web pages.</dd>

        <dt>JavaScript</dt>
        <dd>A programming language that adds interactivity & dynamic behavior to web pages.</dd>
    </dl>
</body>
</html>


Output

Output

In this example:

  • The `<dl>` tag starts the definition list.
     
  • Each term, like "HTML," "CSS," & "JavaScript," is wrapped inside the `<dt>` tag.
     
  • The `<dd>` tag provides the description for each term.
     

When you open this code in a browser, it will display the terms on one line & their descriptions indented below them. This makes the content easy to read & understand.

The `<dt>` tag is not used alone; it works as part of a group with `<dl>` & `<dd>`. Without these tags, the structure would not make sense. For example, using just `<dt>` without `<dd>` would leave the term without an explanation, which defeats the purpose of a definition list.

Syntax

The <dt> tag is used inside a <dl> (description list) to represent a term or name. Here’s the basic syntax:

<dl>
    <dt>Term 1</dt>
    <dd>Definition of Term 1</dd>
    <dt>Term 2</dt>
    <dd>Definition of Term 2</dd>
</dl>

 

Explanation:

  • <dl>: Defines the description list.
     
  • <dt>: Defines the term.
     
  • <dd>: Provides the description of the term.

Examples

Example 1: Basic Usage of <dt> Tag

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>DT Tag Example</title>
</head>
<body>
    <h2>Computer Science Terms</h2>
    <dl>
        <dt>HTML</dt>
        <dd>HyperText Markup Language, used for structuring web pages.</dd>
        <dt>CSS</dt>
        <dd>Cascading Style Sheets, used for styling web pages.</dd>
        <dt>JavaScript</dt>
        <dd>A programming language that adds interactivity to web pages.</dd>
    </dl>
</body>
</html>

 

Output:

Output
  • HTML: HyperText Markup Language, used for structuring web pages.
     
  • CSS: Cascading Style Sheets, used for styling web pages.
     
  • JavaScript: A programming language that adds interactivity to web pages.

Example 2: Using <dt> with Multiple Definitions

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Multiple Definitions</title>
</head>
<body>
    <h2>Programming Languages</h2>
    <dl>
        <dt>Python</dt>
        <dd>A high-level, interpreted programming language.</dd>
        <dd>Used for web development, data science, and automation.</dd>
        <dt>Java</dt>
        <dd>A general-purpose programming language.</dd>
        <dd>Often used for building enterprise applications.</dd>
    </dl>
</body>
</html>


Output

Output

Explanation:

  • Each <dt> tag can have multiple <dd> tags.
     
  • This helps in providing multiple definitions or explanations for a single term.

Supported Browsers

The <dt> tag is supported by all modern web browsers. Here is a compatibility table:

Browser Support

BrowserSupport
Google Chrome Yes
Mozilla Firefox Yes
Microsoft Edge Yes
Safari Yes
Opera Yes

Since the <dt> tag is a fundamental part of HTML, it works seamlessly across all major browsers.

Frequently Asked Questions

What is the purpose of the <dt> tag in HTML?

The <dt> tag is used to define a term in a description list (<dl>). It is followed by a <dd> tag that provides the definition or description of the term.

Can a <dt> tag have multiple <dd> tags?

Yes, a single <dt> tag can have multiple <dd> tags. This is useful when a term has multiple definitions or explanations.

Is the <dt> tag necessary in a description list?

Yes, a description list must contain at least one <dt> tag to define the terms. Without <dt>, the list will not be meaningful.

Conclusion

In this article, we discussed the <dt> tag in HTML, which is used inside a <dl> (description list) to define a term or name in a list. It is paired with the <dd> tag, which provides the description or definition of the term. Understanding the <dt> tag helps in structuring glossary-style content effectively in web pages.

Live masterclass