I have been told on several occasions not to select elements such as <nav>
& <body>
and to instead use the class selectors. For example, "the <nav>
tag is not for display/styling purposes but it is to make the navigation section explicitly separate." But doesn't this defeat part of the the purpose of having semantic elements?
Assuming I have only one navigation list of bullets and I am making them horizontal, adding background, etc., is it still ok to select the nav element over the class?
<nav class="navigation">
<ul class="links">
<li><a href="">Shop</a></li>
<li><a href="">Discounts</a></li>
<li><a href="">Profile</a></li>
<li><a href="">Blog</a></li>
</ul>
</nav>
And, if you're going to down vote me, please provide an explanation instead of just assuming I can intuit why you did it.
Adding a class makes it easier to extend the page later. The class should carry semantic meaning in itself.
If you only select elements and then add more elements of the same type later, you'll have to add classes anyway.
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