HTML <dl> Tag

Beginner
5 min read
Updated: Oct 2026
4 examples
Live preview

Definition and Usage

The <dl> element represents a description list: groups of terms marked with <dt> and descriptions marked with <dd>.

Typical uses are glossaries and metadata (key-value pairs). For plain bullet or numbered lists, use <ul> or <ol> instead.

Baseline · Widely available.

Not deprecated and not experimental. Stable across modern browsers since about July 2015.

Obsolete: compact.

Do not use compact on <dl>. Control spacing with CSS (for example line-height or margin).

HTML Syntax

syntax.html
<dl> <dt>…</dt><dd>…</dd></dl>

Both start and end tags are required. Each group is one or more <dt> followed by one or more <dd>. You may wrap a whole group in <div>.

Attributes

<dl> has no modern element-specific attributes. Legacy markup sometimes used compact:

AttributeDescriptionTry it
compactObsolete. Boolean hint for tighter spacing; browser-specific. Use CSS insteadAvoid
(globals only)Use class, id, lang, and other globals for styling and scriptingTry it

Global Attributes

The <dl> tag also supports the Global Attributes in HTML.

Live Preview

Switch between a short glossary and a metadata list on a real <dl>.

Terms use <dt>; descriptions use <dd>.

Description list
HTML
Markup language for web pages.
CSS
Stylesheet language for presentation.

Glossary pattern: term then description.

HTML Examples

Short, copy-ready snippets. Use Try It Yourself for a live editor.

Example 1 — Basic Glossary

One term and one description per group.

HTML
<dl>
  <dt>HTML</dt>
  <dd>Markup language for web pages.</dd>

  <dt>CSS</dt>
  <dd>Stylesheet language for presentation.</dd>
</dl>
Try It Yourself

How It Works

  1. Open <dl> to start the description list.
  2. Add a <dt> for each term (the name).
  3. Follow with <dd> for that term’s description.
  4. Repeat groups as needed, then close </dl>.

Example 2 — Metadata Key-Value Pairs

Use <dl> for labeled facts such as name, year, or place.

HTML
<dl>
  <dt>Name</dt>
  <dd>CodeToFun</dd>

  <dt>Focus</dt>
  <dd>Learn by doing</dd>

  <dt>Started</dt>
  <dd>2025</dd>
</dl>
Try It Yourself

How It Works

  1. Treat each label as <dt> (Name, Focus, Started).
  2. Put the value in <dd> right after its term.
  3. Keep one pair per group for clear key-value reading.
  4. Style separators in CSS if you want (for example dt::after { content: ": "; }).

Example 3 — One Term, Multiple Descriptions

A single <dt> may be followed by more than one <dd>.

HTML
<dl>
  <dt>Firefox</dt>
  <dd>A free, open-source web browser.</dd>
  <dd>Also a nickname for the red panda.</dd>
</dl>
Try It Yourself

How It Works

  1. Write one <dt> for the shared term.
  2. Add each meaning in its own <dd>.
  3. Keep order clear so readers see every description under that term.
  4. You can also stack several <dt>s before one shared <dd> when synonyms share a definition.

Example 4 — Wrap Groups in <div>

HTML allows wrapping each name-value group in a <div> for styling or microdata.

HTML
<dl>
  <div>
    <dt>Name</dt>
    <dd>Godzilla</dd>
  </div>
  <div>
    <dt>Born</dt>
    <dd>1952</dd>
  </div>
</dl>
Try It Yourself

How It Works

  1. Keep <dl> as the outer list.
  2. Wrap each dt + dd group in a <div>.
  3. Apply class/id/lang on the div when the whole pair needs one hook.
  4. Skip the wrapper when you do not need per-group styling or metadata.

Edge Cases & Pitfalls

Most issues come from wrong list type, fake indentation, or obsolete attributes.

semantics

Not for bullets or numbers

Use <ul> or <ol> for unordered and ordered items. Reserve <dl> for term/description groups.

misuse

Do not fake indentation

Using <dl>/<dd> only to indent text is incorrect. Set spacing with CSS margin or padding.

obsolete

Skip compact

The compact attribute is obsolete. Tighten lists with CSS instead.

structure

Keep valid groups

Each group needs dt then dd (one or more of each). Do not leave orphan terms or descriptions outside that pattern.

a11y

Screen readers vary

Announcement of <dl> differs by assistive tech. Prefer clear term/description text; be cautious adding ARIA term/definition roles on top of native markup.

Browser Support

The <dl> element is core HTML in every browser. It is not a Node.js, Deno, or Bun API.

✓ Baseline · Widely available

<dl>

Widely available since about July 2015 (and long before as description/definition lists). Chrome, Firefox, Safari, Edge, and Opera all support it fully.

98% Global support (approx.)
Google Chrome All
Full support
Mozilla Firefox All
Full support
Apple Safari All
Full support
Microsoft Edge All
Full support
Opera All
Full support
Samsung Internet All
Full support
Internet Explorer All
Supported
<dl> Widely supported

Bottom line: Safe to use everywhere for glossaries and key-value description lists. Skip obsolete compact.

Key Takeaways

  • Role: <dl> holds term/description groups with <dt> and <dd>.
  • Uses: glossaries, metadata pairs, and similar name-value content.
  • Flexible groups: many dt, many dd, or wrap a pair in <div>.
  • Avoid: obsolete compact, and using dl only for indentation.

One line: a good <dl> pairs real terms with real descriptions — not fake spacing.

Default CSS Settings

Typical user-agent styling for the list container (exact values can vary slightly by browser):

default.css
dl {
  display: block;
  margin-block: 1em;
  margin-inline: 0;
}

dt {
  display: block;
}

dd {
  display: block;
  margin-inline-start: 40px;
}

Adjust indent and spacing with CSS on dt/dd — never with obsolete compact.

Frequently Asked Questions

The dl element represents a description list: groups of terms (dt) and descriptions (dd). Common uses are glossaries and metadata key-value pairs.
One or more name-value groups: one or more dt elements followed by one or more dd elements. You may wrap each group in a div. Script and template elements are also allowed as intermixed content.
Yes. Place multiple dd elements after a dt (or after several dt elements that share those descriptions).
Yes. List multiple dt elements, then one or more dd elements that apply to all of them.
No for new pages. compact is obsolete. Control spacing with CSS such as line-height or margin instead.
No. Using dl or dd just to indent text is incorrect. Use CSS margin or padding on the right element for spacing.

Next: DOCTYPE

Declare the HTML document type correctly at the top of every page.

DOCTYPE tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

12 people found this page helpful