WeSearch

On The <dl>

Ben Myers· ·6 min read · 0 reactions · 0 comments · 12 views
#html#web accessibility#semantics
On The <dl>
⚡ TL;DR · AI summary

The <dl> element is a useful HTML feature for representing lists of name-value pairs. It consists of three components: <dl> for the list, <dt> for the term, and <dd> for the description. Using <dl> enhances web accessibility by allowing screen readers to interpret the structure of the information more effectively than traditional nested <div>s.

Key facts
Original article
Ben Myers · Ben Myers
Read full at Ben Myers →
Opening excerpt (first ~120 words) tap to expand

Introduction The <dl>, or description list, element is underrated. It’s used to represent a list of name–value pairs. This is a common UI pattern that, at the same time, is incredibly versatile. For instance, you’ve probably seen these layouts out in the wild… Each of these examples shows a list (or lists!) of name–value pairs. You might have also seen lists of name–value pairs to describe lodging amenities, or to list out individual charges in your monthly rent, or in glossaries of technical terms. Each of these is a candidate to be represented with the <dl> element. So what does that look like? The Anatomy of a Description List I’ve been saying “<dl>,” when really, I’m talking about three separate elements: <dl>, <dt>, and <dd>. We start with our <dl>.

Excerpt limited to ~120 words for fair-use compliance. The full article is at Ben Myers.

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Threads WhatsApp Bluesky Mastodon Email

Discussion

0 comments

More from Ben Myers