The <dt> tag in HTML is used to specify the description list. It is used inside the <dl> element. It is usually followed by a <dd> tag. The subsequent <dd> elements provides some related text associated with the term specified using <dt>.
Syntax:
<dt> Content... </dt>
Example: In this example, we are using the <dt> (definition term) tag within a <dl> (description list). It lists terms like “Geeks Classes,” “Fork Python,” and “Interview Preparation,” each with corresponding descriptive details.
HTML
<!DOCTYPE html>
<html>
<body>
<h1>GeeksforGeeks</h1>
<h2><dt> Tag</h2>
<dl>
<!-- HTML dt tag -->
<dt>Geeks Classes</dt>
<dd>It is an extensive classroom programme for
enhancing DS and Algo concepts.</dd><br>
<!-- HTML dt tag -->
<dt>Fork Python</dt>
<dd>It is a course designed for beginners in
python.</dd><br>
<!-- HTML dt tag -->
<dt>Interview Preparation</dt>
<dd>It is a course designed for preparation of
interviews in top product based companies.</dd>
</dl>
</body>
</html>
Output:
Supported Browsers:
HTML dt Tag – FAQs
Can a <dt> tag have multiple associated <dd> tags?
Yes, a single <dt> tag can be followed by multiple <dd> tags, allowing for multiple descriptions or definitions for the same term.
Can I have multiple <dt> tags before a single <dd> tag?
Yes, it’s valid to have multiple <dt> tags before a single <dd> tag. This is useful when several terms share the same description.
Is the <dt> tag a block-level element?
Yes, the <dt> tag is a block-level element. It typically takes up the full width available and starts on a new line.
Can the <dt> tag be nested inside other elements?
The <dt> tag can only be used inside a <dl> element. It cannot be used inside other elements like <div>, <section>, or outside a <dl> context.
Can I include links, images, or other elements inside a <dt> tag?
Yes, you can include links (<a>), images (<img>), or even inline styling inside a <dt> tag to provide additional context or enhance the term’s appearance.