View Single Post
Old 06-04-2013, 03:21 AM   #100
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,557
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by JSWolf View Post
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.
Jellby is offline   Reply With Quote