list or no list for nav links
Just noticed that Porkbun just have the bare <a> tags separated by <br>
7 Replies
It’s more semantic to be a
nav
ul
li
a
and then you don’t need the <br/> bc <li> are block level elements
Interesting that all the elements have empty class attributes
yea it is strange
I wonder why they opt not to do it
I know with screen readers it means that more is read out, but I guess thats not a bad thing
It’s more about the context semantic elements and aria attributes give to the assistive technologies and the user.
A div with a bunch of links doesn’t tell the user this is a nav menu
Or that Products is the label
right
I tend to not use lists for nav links or indeed anything that isn’t strictly a list. It creates unnecessary markup. In this case I would use a <nav> container and then flex or grid to define the layout and spacing.
Do you nest nav-elements for sub-navigations inside the parent
<nav>
? – and the aria-role just applies to the parent element I guess. HTML 5.5 <subnav>
when ... lol