squirrelscan
GitHub

dt and dd outside a dl: orphaned definition list items

A dt or dd that is not inside a dl loses the term-description pairing entirely. squirrel finds every orphan on every page.

What an orphaned dt or dd is

<dt> and <dd> earn their meaning from the <dl> that contains them: this term goes with that description. Outside a <dl> the elements still map to term and definition roles, but the grouping that pairs them is gone, so a screen reader has no relationship to announce and the reader hears two unrelated blocks of text.

The usual cause is a component that renders a term-description pair without rendering the list around it, or a refactor that moved the wrapper and left the items behind.

What squirrel checks

One check, dlitem, at severity error. For every <dt> and <dd> it looks at the immediate parent. That parent is valid when it is a <dl>, or a <div> whose own parent is a <dl>.

  • Fail with N dt/dd element(s) not inside a dl. Items quote the first 20 characters of the element’s text, as dt: "Shipping address for...", up to ten with a count of the rest.
  • Pass with All dt/dd elements are inside definition lists.
  • Info with No dt/dd elements found.

Exactly one wrapper level is allowed. A <dl> containing a <section> containing the <dt> is reported, which matches HTML: only <div> may wrap a group.

How to fix it

<dl>
  <dt>Shipping address</dt>
  <dd>12 Rue de Rivoli, Paris</dd>
</dl>

Wrap the orphans in a <dl>. If the pair is not really a term and a description, use a heading and a paragraph instead, which carry the right semantics without a container.

Where a component renders one pair at a time, render the <dl> in the parent and the <div> group in the component, so every item ships inside a list.

Rule IDa11y/dlitem
CategoryAccessibility
ScopePer-page
Severityerror
Weight7/10

Enable / disable

Disable this rule

[rules]
disable = ["a11y/dlitem"]

Disable all Accessibility rules

[rules]
disable = ["a11y/*"]

Enable only this rule

[rules]
enable = ["a11y/dlitem"]

enable replaces the default ["*"], so this is the only rule selected. Leave disable out: a rule that matches any disable pattern is skipped even when enable names it. Only an enabled setting under a rule’s own [rule_options] table overrides both lists.

Accessibility findings ship in every audit next to the SEO, performance and agent experience rules. See Website security scan with AI for how an agent works through a report.

References

Check your site

Run squirrel audit https://example.com and open the Accessibility section of the report. Each orphan is listed with the opening words of its text. Signed-out local audits need no account and cost nothing. Signed-in audits spend credits.

Type to search…

↑↓ navigate↵ openesc close