Quote:
Originally Posted by JSWolf
But to be honest, I don't actually see the use for defining an ID in CSS instead of a class.
|
Sometimes you need special values for one particular instance, and images are a common case.
Have a look at my Tom Sawyer ePub, the chapter title illustrations have a code to wrap the text around them, and since every image is a different size, the code needs to be different.
Of course, I could have created a class for each image, but creating a class for something that will never ever have more than one member is as wrong as creating a different id for things that are no different at all
So, in general I agree, classes are to be preferred, but ids have their uses too.