list or no list for nav links

Just noticed that Porkbun just have the bare <a> tags separated by <br>
No description
6 Replies
Zach Jensz
Zach JenszOP9mo ago
No description
curiousmissfox
curiousmissfox9mo ago
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
Zach Jensz
Zach JenszOP9mo ago
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
curiousmissfox
curiousmissfox9mo ago
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
Zach Jensz
Zach JenszOP9mo ago
right
Chris Bolson
Chris Bolson9mo ago
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.

Did you find this page helpful?