Ensure that Lists Are Structured Correctly

Photo of Researcher
Yotam Flohr
Researcher
Blind Hearing
WCAG 2.1 Level A

Written and researched for humans by humans

Photo of Researcher
Yotam Flohr
Researcher
Photo of Expert
Ritvik Shrivastava
Expertly reviewed by
Comments: 0
Your entire domain
Get detailed instructions on how to resolve every accessibility issue on your website

Lists must be marked up correctly, meaning they cannot contain content elements other than li elements.

Why It Matters

Screen readers have a specific way of reading lists out loud to users, but this only works if lists are properly structured.

 

For a list to be valid, it must have both a set of ul elements or a set of ol elements and child elements.

Although some non-content elements such as script, template, style, meta, link, map, area, and datalist are permitted within lists, content elements other than li are not permitted.

Fixing the Issue

Ensure all ordered and unordered lists (defined by ul or ol elements) contain only li content elements.

Good Code Example

Code example
<p> These are a few of my favorite things</p> <ul> <li>Raindrops on roses</li> <li>Whiskers on kittens</li> <li>Bright copper kettles</li> <li>Warm woolen mittens</li> <li>Brown paper packages tied up with strings</li> <li>Cream colored ponies</li> <li>Crisp apple streudels</li> <li>Doorbells and sleigh bells</li> <li>Schnitzel with noodles</li> <li>Wild geese that fly with the moon on their wings</li> <li>Girls in white dresses with blue satin sashes</li> <li>Snowflakes that stay on my nose and eyelashes</li> <li>Silver white winters that melt into springs</li> </ul> Copy