Keeping it on the < dl > – another HTML gem you never use

In a moment of boredom, I wrote a little app/web page that shows lovely words we should be using more. It is done in plain HTML, JavaScript, and some CSS. The source code is available, and I am also happy to receive pull requests adding more lovely words. This is not what I wanted to […]


This content originally appeared on Christian Heilmann and was authored by Chris Heilmann

In a moment of boredom, I wrote a little app/web page that shows lovely words we should be using more. It is done in plain HTML, JavaScript, and some CSS. The source code is available, and I am also happy to receive pull requests adding more lovely words.

screenshot of the application showing the lovely word Cattywampus

This is not what I wanted to talk about today. Instead, I wanted to talk about a thing I used that I don’t see being used in the wild enough: Description Lists. Never heard of them? You are not alone…

One in 10 Americans think HTML is a sexually transmitted disease

HTML, as you may remember, is not about adding look and feel to a document, but about giving it structure. A definition list is the right thing to use when you have a list of terms and definitions. This is a pretty common thing on the web, and yet I hardly ever see any in use. The first time I came across a description list was in the bookmarks.htm file of Netscape. Here is how description lists are defined:

HTML

Hypertext Markup Language – a language to describe content on the web.

Without any CSS they render as terms on lines with a break and descriptions with an indent.

It may be that people don’t know about or don’t use description lists as they have a syntax that is different from other lists. Both unordered (UL) and ordered (OL) lists are parent elements to one or more list item (LI) elements. Description lists are different. The DL element is the direct parent to both the term (DT) and the description element (DD), and there can be more than one of each. Some terms have more than one description, and one description may apply to various terms. MDN has some great demos:

Firefox

Mozilla Firefox

Fx


A free, open source, cross-platform, graphical web browser developed by the
Mozilla Corporation and hundreds of volunteers.


Firefox


A free, open source, cross-platform, graphical web browser developed by the
Mozilla Corporation and hundreds of volunteers.


The Red Panda also known as the Lesser Panda, Wah, Bear Cat or Firefox, is a
mostly herbivorous mammal, slightly larger than a domestic cat (60 cm long).


The practical upshot of using description lists is that you have baked-in accessibility. Both the term and the description get announced as roles to assistive technology. You can spot-check that using the element picker in the browser developer tools.

The browser developer tools element picker showing that a dt element has a role of term

The browser developer tools element picker showing that a dd element has a role of definition

Another excellent example on MDN is that you can use description lists to describe metadata as a list of key-value pairs:

Name

Godzilla

Born

1952

Birthplace

Japan

Color

Green

So, next time you have a list of items you want to describe, why not reach deeper into the HTML treasure chest and use a description list?


This content originally appeared on Christian Heilmann and was authored by Chris Heilmann


Print Share Comment Cite Upload Translate Updates
APA

Chris Heilmann | Sciencx (2025-04-18T10:19:58+00:00) Keeping it on the < dl > – another HTML gem you never use. Retrieved from https://www.scien.cx/2025/04/18/keeping-it-on-the-dl-another-html-gem-you-never-use/

MLA
" » Keeping it on the < dl > – another HTML gem you never use." Chris Heilmann | Sciencx - Friday April 18, 2025, https://www.scien.cx/2025/04/18/keeping-it-on-the-dl-another-html-gem-you-never-use/
HARVARD
Chris Heilmann | Sciencx Friday April 18, 2025 » Keeping it on the < dl > – another HTML gem you never use., viewed ,<https://www.scien.cx/2025/04/18/keeping-it-on-the-dl-another-html-gem-you-never-use/>
VANCOUVER
Chris Heilmann | Sciencx - » Keeping it on the < dl > – another HTML gem you never use. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/04/18/keeping-it-on-the-dl-another-html-gem-you-never-use/
CHICAGO
" » Keeping it on the < dl > – another HTML gem you never use." Chris Heilmann | Sciencx - Accessed . https://www.scien.cx/2025/04/18/keeping-it-on-the-dl-another-html-gem-you-never-use/
IEEE
" » Keeping it on the < dl > – another HTML gem you never use." Chris Heilmann | Sciencx [Online]. Available: https://www.scien.cx/2025/04/18/keeping-it-on-the-dl-another-html-gem-you-never-use/. [Accessed: ]
rf:citation
» Keeping it on the < dl > – another HTML gem you never use | Chris Heilmann | Sciencx | https://www.scien.cx/2025/04/18/keeping-it-on-the-dl-another-html-gem-you-never-use/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.