logoalt Hacker News

On The <dl>

68 pointsby ravenicaltoday at 1:03 PM18 commentsview on HN

Comments

captn3m0today at 1:57 PM

> Prior to HTML5, this was called a definition list. This is because the <dl> was originally only intended to represent glossaries of terms and their definitions.

TIL I’ve been naming it wrong for a decade.

Demiurgetoday at 2:29 PM

I love DL. I think tables, at least in the past, were misused as DLs even more in the past and the inconvenience of the table markup is even worse than a bunch of divs.

show 2 replies
simonwtoday at 2:29 PM

Here's a useful note on how well screen readers support DL: https://adrianroselli.com/2025/01/updated-brief-note-on-desc...

cloud-oaktoday at 2:09 PM

The final example of the DnD statt sheet makes me think whether it's legal to nest <dl>s?

I.e. can we do

    <dl>
      <dt>Actions</dt>
      <dd><dl>...</dl></dd>
    </dl>
show 1 reply
michalctoday at 2:18 PM

The GOV.UK Design System summary list component is a description list https://design-system.service.gov.uk/components/summary-list...

And... it also uses the wrapper div for styling

phyzix5761today at 1:51 PM

I'm curious if the spec actually says you can only wrap it with a div because I like to do semantic html and name my elements specific to my domain.

show 4 replies
mockbuildtoday at 2:38 PM

it's on archive html5 .flac 16-bit 44.1kHz no <dl> flag.

rickstanleytoday at 1:50 PM

I've used this a good amount of times, when I coded in front end projects. The first time gave me that satisfying feeling of using the right tool for the job, like completing a puzzle of HTML semantics. I remember JAWS not announcing it correctly in 2018, not sure if it's better now.

show 1 reply
gbeardishtoday at 2:19 PM

What about multiple '&lt;dt&gt;' for one or more '&lt;dd&gt;'?

turtleyachttoday at 1:15 PM

Hoped to see CSS for the alternative, where <div> is not nested inside the <dl>. Too used to thinking of div as "layout containers."

Telemakhostoday at 1:49 PM

I was a bit surprised to see nested <div>s given as some sort of precursor pattern, when <dl> was part of HTML before 2.0 back in the days of table layout.

jdw64today at 2:11 PM

blog looks beautiful. I really wish I had this kind of talent for frontend.

MattRixtoday at 2:04 PM

Good title