RE: Lists inside nav necessary?

There are a couple of considerations:

1. WCAG SC 1.3.1 effectively says that the visual appearance of things needs to be conveyed programmatically. So if a number of links are grouped visually, as is the case with a menu, then they should be grouped programmatically. A list is the obvious way to do that. Although the <nav> element implies some sort of grouping, this is not its purpose.

2. I was about to mention the benefits for the user experience, but Léonie beat me to it.

Steve Green
Managing Director
Test Partners Ltd


-----Original Message-----
From: Tobias Bengfort <tobias.bengfort@posteo.de> 
Sent: 11 June 2020 10:47
To: WAI IG <w3c-wai-ig@w3.org>
Subject: Lists inside nav necessary?

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

Received on Thursday, 11 June 2020 10:02:11 UTC