<ul> and <ol> must only directly contain <li>, <script> or <template> elements
How to fix the list accessibility rule. Page structure and lists.
What this rule checks
Ensure that lists are structured correctly
Who is affected
A list contains things other than list items, so screen readers announce the wrong number of items or break the list up.
How to fix it
Only put <li> (or <script>/<template>) directly inside <ul> and <ol>.
Example
Before
<ul><div>Item</div></ul>After
<ul><li>Item</li></ul>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)
Find it on your own page
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.
More detail
- Deque University’s reference for list (the makers of axe-core, the engine our scanner uses)
- All fix guides