<nav>
<a href="#">Home</a>
<a href="#">Kontakt</a>
<a href="#">Jovan</a>
</nav>
or
<nav>
<ul>
<li> <a href="#">Home</a> </li>
</ul>
</nav>
Which is better? When the only nav
and <a>
or latter. In the first should not be placed in the CSS <inline>
Accoridng to the W3 spec on <nav>
, any kind of flow content
is acceptable. And, not that it's of great importance, but both W3 & MDN demonstrating its use using an <ul>
(and, for what it's worth, W3 even includes a heading above the <ul>
to title the section).
Personally, I think a <ul>
describes multiple links better than just solo <a>
s, but it's really up to how you want to do it. <ul>
also lends itself more semantically to multiple links than simply floating anchors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With