>> By the way, can you tell me the difference between:
>> div.item {blah blah}
>> and simply
>> .item {blah blah}
>> ?

> div.item {...}
> Means something like, it tells the software (the browser) to find  /any 
> division element/ with a class attribute called "item"
> And is more specific than just:

> .item {...}
> telling the software to find /any element/ with a class attribute called 
> "item"

All of that is right, I'm just going add my two cents on usage.

I default to the tag.class syntax as a form of self documentation.  There 
aren't that many times you want to give the same class to multiple tags and 
have it do the same thing, so including the tag, even when it's not strictly 
necessary, lets you know what it's applying to, so you have a better idea of 
what other styles (default browser styles, tag specified styles, etc) are being 
added to or over-ruled.  You can always remove the tag name if you discover 
that you really want to apply the class to a whole bunch of tags.

I do the same thing for id selectors (#thisSpecificThing), even though id's are 
unique, so they only specify one element anyway.  That means that "div#content" 
instead of "#content" is totally redundant, but again, easier to comprehend 
(IMHO).

End of my $0.02.

---Tim
______________________________________________________________________
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to