Sent by Matthias Kestenholz on 1 March 2005 10:10
Hi,
On Tue, 2005-03-01 at 10:06 +0000, Bob McClelland wrote:
>Hello everyone,
>
>I've noticed that, quite often, some folk use classes of the type:
>
> div#links {etc . . .}
>
>whereas I would just use :
>
> #links {etc . . .}
>
>So, seeing as some of those who do this are pretty darn good at it, I
>presume there is a reason for the 'div'?
There is no reason to write the "div" when used with an element ID
( #links ) other than readability since ID's must be unique.
If used with classes however ( div.links ), things are a bit different
because you can then assign the same classed to different tags and let
them all behave differently ( f.e. a.link, div.link, span.link ).
I think that would be bad style, because you (or another person
updateing the website) would always have to look twice to be sure which
CSS rules apply to which HTML elements...
Dean Edwards writes about efficient CSS when using his IE7 package. I
don't think the differences in (CSS) performance will be noticeable if
you don't use some sort of Javascript to parse and modify the DOM.
http://dean.edwards.name/IE7/usage/optimise.html
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/