list or no list for nav links

Just noticed that Porkbun just have the bare <a> tags separated by <br>
No description
7 Replies
Zach
ZachOP3d ago
No description
clevermissfox
clevermissfox3d 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
ZachOP3d 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
clevermissfox
clevermissfox3d 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
ZachOP3d ago
right
Chris Bolson
Chris Bolson3d 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.
Simon
Simon2d ago
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

Did you find this page helpful?