On the <dl>
Mirrored from Simon Willison for archival readability. Support the source by reading on the original site.
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.
Via Hacker News
Tags: css, html, screen-readers, web-standards
More from Simon Willison
-
The memory shortage is causing a repricing of consumer electronics
May 22
-
FTC to Require Cox Media Group, Two Other Firms to Pay Nearly $1 Million to Settle Charges They Deceived Customers About “Active Listening” AI-Powered Marketing Service
May 22
-
Datasette Agent
May 21
-
datasette-agent-sprites 0.1a0
May 21
Discussion (0)
Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.
Sign in →No comments yet. Sign in and be the first to say something.