Home 〉 HTML Tutorials 〉 HTML Description List Tag - Learn '<dl>', '<dt>', '<dd>' with Syntax, Attributes & Examples
HTML Description List Tag - Learn '<dl>', '<dt>', '<dd>' with Syntax, Attributes & Examples !
What are HTML Description Tags and how do they work?
The HTML description list tag ('<dl>') along with '<dt>' and '<dd>' is useful for presenting terms and their definitions. These tags are block-level elements and support all standard global attributes. We've shown practical examples using CSS inline styling for a clean layout. Understanding these tags is important for creating semantically structured and accessible content. The detailed blog post on HTML description list tag is as follows.
HTML provides different types of lists to organize content. Among these, the HTML Description List is used when you want to list items with a term and a description — perfect for glossaries or definitions. It uses three elements:
'<dl>', '<dt>', and '<dd>' are block-level elements.
Let's walk through the syntax, examples, attributes, and inline CSS styling to help you understand how to use these tags properly.
Syntax ✍
<dl>
<dt>HTML</dt>
<dd>A markup language for creating web pages.</dd>
</dl>
These tags support global attributes like 'id', 'class', 'style', and 'title'.
<!DOCTYPE html>
<html>
<body>
<dl style="border: 1px solid #ccc; padding: 10px; border-radius: 5px;">
<dt style="font-weight: bold; color: #2e86de;">CSS</dt>
<dd style="margin-left: 20px; color: #555;">A stylesheet language used to describe the look of HTML documents.</dd>
</dl>
</body>
</html>
output 📌
You can Try the above code by changing the values in our user-friendly code editor by clicking the "Try It" button and see the output of the same.
Here are some useful CSS properties you can apply directly:
<!DOCTYPE html>
<html>
<body>
<dl style="background-color: #f9f9f9; padding: 15px; border: 1px solid #ddd;">
<dt style="color: #333; font-size: 18px;">JavaScript</dt>
<dd style="color: #666;">A programming language used to make web pages interactive.</dd>
</dl>
</body>
</html>
output 📌
You can Try the above code by changing the values in our user-friendly code editor by clicking the "Try It" button and see the output of the same.
Yes, you can have multiple '<dt>' tags and their corresponding '<dd>' tags inside a single '<dl>'.
Not necessarily. They can be used wherever a term-description structure fits, like FAQs or metadata.
Yes, they improve content structure and are favored in semantic HTML.
Yes, you can use tags like '<p>', '<a>', or '<span>' inside '<dd>' for enhanced formatting.