loading...

re: Reasons not to use IDs in CSS VIEW POST

TOP OF THREAD FULL DISCUSSION
re: What is the your recommendation for use of id's? I'm currently using them for single page elements that are not going to be reused i.e. a front pag...
 

No there's no reason you can't use classes everywhere for styling. Even if you think you'll only want to use a style once, there's no reason not to use a class for it. I can see why you would define "single-use" styles on the IDs but there isn't any advantage to doing that except for the higher specificity. I prefer to reserve IDs for other uses such as form labels and linking to anchor tags and keep all my styles defined by classes, for consistency.

Code of Conduct Report abuse