WeSearch

On the <dl>

Simon Willison· ·1 min read · 0 reactions · 0 comments · 19 views
#html#web development#accessibility
⚡ TL;DR · AI summary

The article discusses the <dl> element in HTML and its features. It highlights that a <dt> can be followed by multiple <dd> elements and can be grouped in a <div> for styling. Additionally, it mentions the use of ARIA for labeling and clarifies the terminology around description lists.

Key facts
Original article
Simon Willison's Weblog · Simon Willison
Read full at Simon Willison's Weblog →
Opening excerpt (first ~120 words) tap to expand

On the <dl> (via) I learned a few new-to-me things about the <dl> element from this article by Ben Meyer: A <dt> can be followed by multiple <dd> You can optionally group the <dt> and <dd> elements in a <div> for styling - but only a <div>. You can label them using ARIA. They've been called "description lists", not "definition lists", since an HTML5 draft in 2008. So this is valid: <h2 id="credits">Credits</h2> <dl aria-labelledby="credits"> <div> <dt>Author</dt> <dd>Jeffrey Zeldman</dd> <dd>Ethan Marcotte</dd> </div> </dl> Here's a useful note from Adrian Roselli on screen reader support for description lists.

Excerpt limited to ~120 words for fair-use compliance. The full article is at Simon Willison's Weblog.

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

Discussion

0 comments