Hi everyone,
One thing that has always eluded me, is when should one use an id over a class?
The only difference I have ever been able to find is that id's can only be used once on a page... But if that's truly the only difference, why ever use an ID? Why not always use classes, since it makes markup easier down the road if you realize later you want to reuse something?
-patrick
IDs have higher specificity
IDs have higher specificity so in the case of something that is nested, your CSS rule may be shorter by using an ID than a class, e.g.
p#different { }
instead of
.rule1 .rule2 .rule3 p.different { }
Also, accessing elements via javascript is different depending on whether it's a class or ID.
http://www.csscreator.com/nod
http://www.csscreator.com/node/7113
But it probably would be a good idea to modify the article to explain the "why"