Re: Lists inside nav necessary?

It is helpful to use both the nav element and the list elements inside
it. The reason is that the nav element informs screen reader users that
they are in a part of the page that relates to navigation and provides a
"landmark" for them to be able to navigate to with a shortcut. The list
inside it informs screen reader users that there is a "list of N items"
where N is the number of li elements inside the ol/ul, and this helps
screen reader users judge the size of the navigation block and from
there to decide on their strategy for navigating through it, over it, or
something else.


On 11/06/2020 10:47, Tobias Bengfort wrote:
> Hi,
> 
> I often find myself building navigation like this:
> 
> ```
> <nav>
>   <ul>
>     <li><a href="…">…</a></li>
>     <li><a href="…">…</a></li>
>     <li><a href="…">…</a></li>
>   <ul>
> </nav>
> ```
> 
> That is: a flat list of links wrapped in li, ul, and nav. I keep
> wondering whether there is actually any benefit over a simplified
> structure like this:
> 
> ```
> <nav>
>   <a href="…">…</a>
>   <a href="…">…</a>
>   <a href="…">…</a>
> </nav>
> ``
> 
> That is: Just a nav containing links, without the list.
> 
> Do you have experience with this?
> 
> thanks
> tobias
> 

-- 
Director @TetraLogical

Received on Thursday, 11 June 2020 09:57:07 UTC