HTML Buddies: <dt>
& <dd>
Description (nee definition) lists are a bit of an outlier in HTML lists. Like ordered and unordered lists, they can be nested. Unlike ordered and unordered lists, they are made up of key/value pairs.
They are also exposed to assistive technology differently and, depending on screen reader chosen, sometimes do not convey what they are.
- NVDA:
- Announces as
list
, - Counts both
<dt>
&<dd>
when providing the list item count, - Skips
<dd>
s when navigating by list item (I). - JAWS:
- Announces as
definition list
, - Counts only
<dt>
s when providing the list item count, - Skips
<dd>
s when navigating by list item (I). - Voiceover (macOS):
- Announces as
description list
, - Counts both
<dt>
&<dd>
when providing the list item count, - Voiceover (iOS):
- Does not announce the presence of a list,
- Does not provide any count nor convey that the user is in a list,
- When navigating by lists, it is not recognized.
- TalkBack (Android):
- Announces as
list
, - Counts both
<dt>
&<dd>
when providing the list item count, - Skips
<dd>
s when navigating by list item. - When focus is on a
<dd>
, after speaking the text it addsdefinition
. - Narrator
- Announces as
list
, - Counts both
<dt>
&<dd>
when providing the list item count, - There is no option to navigate by list or list item.
Of course, once you start messing with CSS display properties, browsers dump all the information and pass along nothing to assistive technology. You can add it back with ARIA, but ARIA has no roles that map to the description list, so you may have to assign it a regular list role. See the links below for more information.
References
- While not explicitly about lists, my post Tables, CSS Display Properties, and ARIA demonstrates how easily you can accidentally strip the semantics of an element.
- If you need to add ARIA to your lists due to adding CSS display properties, you can retrofit the list function from my post Functions to Add ARIA to Tables and Lists.
- Scott O’Hara walks us through how screen readers announce the other list types in his post ARIA Lists.
- This pen is for the May 2018 week 4 CodePen challenge, HTML Buddies.
- See all four of my pens for this challenge at my site with additional context.