Lists contain only <li> elements and script supporting elements (<script> and <template>)

Lists use correct markup so screen readers can announce them properly.

On this page

Impact

ScanGov impact ratings

About

Screen readers have a specific way of announcing lists. Ensuring proper list structure aids screen reader output.

Risks

Screen readers announce structured content incorrectly.

Why it's important

Helps screen readers announce structured content (tables, lists) in a logical order that users can understand.

User stories

As a screen reader user, I want tables and lists to be properly structured so that I can understand the relationships between items.

Code

Failing pattern:

<!-- Fail: non-li child inside ul -->
<ul>
  <div>Item one</div>
</ul>

Passing pattern:

<!-- Pass: only li children -->
<ul>
  <li>Item one</li>
  <li>Item two</li>
</ul>

Error

ScanGov messaging when a site fails a standard:

Failed: Lists contain only <li> elements and script supporting elements (<script> and <template>)

Guidance

Indicators

On this page