For A19, I'd use SMACSS :P
.navList { list-style: none; padding-left: 0; } .navList--item { display: inline-block; } .navList--link { color: white; background-color: green; padding: 5px; text-decoration: none; } .navList--link-featured { background-color: orange; }
<nav> <ul class="navList"> <li class="navList--item"> <a href="#" class="navList--link">toys</a> </li> <li class="navList--item"> <a href="#" class="navList--link navList--link-featured">treats</a> </li> </ul> </nav>
Not as concise, but:
Removed the margin-top as letting the parent handle it means .navList can be reusable.
margin-top
.navList
I love SMACSS. Knowing the specificity rules is good, but not needing to is even better.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
For A19, I'd use SMACSS :P
Not as concise, but:
Removed the
margin-top
as letting the parent handle it means.navList
can be reusable.I love SMACSS. Knowing the specificity rules is good, but not needing to is even better.