WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Roles for nest lists


From: Léonie Watson
Date: Dec 11, 2015 11:41AM

> From: WebAIM-Forum On Behalf Of Greg Gamble
> Sent: 11 December 2015 18:36
> I have a nested list ... is it given the same roles as the parent?

It is, but you don't need to use the roles if you're using the HTML ul/li elements.



<div role="list">
<span role="listitem">Fruit>
<div role="list">
<span role="listitem">Apples</span>
<span role="listitem">Bananas</span>
<span role="listitem">Vegetables</span>

Note: The use of div and span in the second example is arbitrary. You could use all spans or all divs for example.


@LeonieWatson tink.uk Carpe diem