I have a pretty marginal question. I was wondering if it is better to use the id
or class
attribute when either would yield the same result. I'm not asking about the differences between id and class.
I know the answer. Should I use id
if I'm sure it will be unique? Or, should I use class in every case except when id is absolutely necessary?
Basically, should I be as specific as possible or as general as possible?
Scenario: Say I have 3 divs. First, second, and third. Use classes or ids?