New Apr 18, 2025

Keeping it on the – another HTML gem you never use

Top Front-end Bloggers All from Christian Heilmann View Keeping it on the – another HTML gem you never use on christianheilmann.com

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?

Scroll to top