Definition list items are not wrapped in <dl> elements
How to fix the dlitem accessibility rule. Page structure and lists.
The message you saw
Lighthouse runs axe-core inside it, so both are the same check, and the fix below works whichever tool showed you the message.
What it means
The <dt> (term) and <dd> (description) elements only make sense inside a description list, <dl>. This message means a <dt> or <dd> sits somewhere else: directly in a <div>, a <section>, or a <dl> whose role was changed.
axe-core accepts a <dt> or <dd> whose parent is a <dl>, or a plain <div> that is itself directly inside a <dl> (the allowed way to group pairs for styling).
Who is affected
A <dt> or <dd> isn't inside a <dl>, so the term and its description aren't announced as a pair.
Screen-reader users: outside a <dl>, the term and description lose their relationship and aren’t announced as a pair (success criterion 1.3.1 Info and Relationships).
How to find it
- Run the checker; it outlines each stray
<dt>or<dd>. - Inspect it in DevTools and look at the parent (and the grandparent, if the parent is a
<div>).
How to fix it
- Wrap the
<dt>/<dd>pairs in a<dl>. - If they are already in a
<div>for styling, make sure that<div>sits directly inside the<dl>and has norole. - If the
<dl>has a role such asrole="list"that isn’t needed, remove it; roles other thanlist,noneorpresentationbreak the structure.
Example
Before
<div class="specs">
<dt>Size</dt><dd>Medium</dd>
</div>After
<dl class="specs">
<dt>Size</dt><dd>Medium</dd>
</dl>WCAG success criteria
When this rule fails, the page fails:
- 1.3.1 Info and Relationships (Level A, WCAG 2.0, 2.1, 2.2)
Check your fix
Scan a web page and the report lists every element that fails this rule, with screenshots outlining where they are, the code, and a selector you can paste into your browser’s developer tools. Scan again after your change: when the rule no longer appears under the problems, the fix worked.
An automated pass means this rule found nothing wrong. It doesn’t prove the page is accessible: some of what WCAG asks for needs a person to check, and the report’s manual checklist lists those steps.
Related fix guides
<dl>'s do not contain only properly-ordered<dt>and<dd>groups,<script>,<template>or<div>elements- List items (
<li>) are not contained within<ul>,<ol>or<menu>parent elements
More detail
- Deque University’s reference for dlitem (the makers of axe-core, the engine our scanner uses)
- W3C’s Understanding 1.3.1
- All fix guides