<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:

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