If you have a choice, use class, then if you need to modify a specific use of the class, use id.
I would still use .footer instead of #footer. Of course you should consider <footer> as well.
If you have a choice, use class, then if you need to modify a specific use of the class, use id.
I would still use .footer instead of #footer. Of course you should consider <footer> as well.
<div class="footer special enterprise">
.footer.special.enterprise {
background-color: blue;
}Way more self describing. No team member will ask which one is reusable and which one is not.
Why?
Of course, you can still do this if you want to. To quote Chris Rock, "you can drive a car with your feet if you want to." But if you work on a large code base that lots of developers have touched, and lots of future developers will touch, you run into these issues all the time. And the bugs that come about can be tough to spot and to fix.
Either remove that, or add the id to the selector with the style.
For me it's a matter of doing things the same way so when I need to make an update to the code in a year it's intuitive.
"Be kind to your future self" is my motto.