the "." names apply to <tag class="something" />
"." is for the class attribute
Ooh OK. So
.fancymenu { }
would work for
<p class="fancymenu">blah</p>
<div class="fancymenu">blah</div>
<ul class="fancymenu">blah</ul>
...
That's actually pretty cool.
]]>I'm mostly using .something {} syntax and it's clear and optimised enough for me.
]]>.something {}
I guess they skipped that option in the webdesign course at my school.
]]>lol.
*shakes head and goes back to his corner*
table tr td { ... }
...sigh....
I think the problem I have wrapping my head around what people do sometimes is that I forget "web designer != developer" and these people don't think like someone who knows how to code...
i generally have a whole mess of .someRule rules, and rarely classify them by element type
]]>I only use the nesting to classify elements that I don't name.
'tbody div' for example. But never for named objects. That is just silly to me.
heh. Silly phrakture. Inducing me to rant.
]]>As far as I know it's mainly used to override an existing rule. e.g. a global td rule to markup all td's in one sweep, and then specific .something rd {} rules to single certain exceptions out.
I've had once a css-only dropdown menu implementation (thus avoiding JS), and there the more obscure things are really needed, but IE didn't eat it.
]]>Why is it better to do:
tr.headingRow {...}
than:
.headingRow {...}
yeah I understand that there's implied usage in the first example... but really, it's not going to cause issues...
Number two... why do people insist on stuff like this:
tr.headingRow td img.customImg { ... }
over:
img.customImg { ... }
Now, I can understand the nesting, only use the customImg inside the headingRow and a td... but, come on people... that's just so restrictive to me... what if you move that td out to a div? you now have to change your stylesheet as well... but with example #2 nothing changes...
some of the stuff I see is rediculous...
td.blah { color: white; }
div.abracadabra { color: white; }
span.customSpan {color: white; }
... etc ...
and this could all be replaced with:
.white { color: white; }
and you save a mess of lines...
so, wtf... can someone explain this to me... who deemed this "proper" usage?
]]>