In article <blq09k$31i$1 (AT) nic (DOT) grnet.gr> in
comp.infosystems.
www.authoring.stylesheets, <- Chameleon ->
<cham_gss (AT) hotmail (DOT) NOSPAM.com> wrote:
Quote:
style
td { ... }
td.a { ... }
/style
td.a style derives from td |
No, it doesn't. I can see why you might think that, but it's a
fundamental misunderstanding. No shame in that: we all had to learn.
But disabuse yourself of the notion that styles "inherit" in that
way, or you'll be constantly frustrated.
First assuming that the two styles don't mention the same property,
you have two possibilities: _Every_ <td> element gets the first set
of properties, and <td class="a"> elements also get the second set
of properties.
Now if there's overlap, for instance if you have td {color:#000} and
td.a {color:#800}, then <td class a> will be in brick red and all
other <td>s will be in black.
Quote:
Now I want a style which derives from td.a
How can I write this? (td.a.b ?) |
No. If you write "td.a .b" that means any element of class b that's
within a <td class="a"> at any level of nesting.
If you want some properties for both <td class="a"> and <td
class="b"> and others for only <td class="b">, write it this way:
td.a, td.b {color:#000}
td.b {font-weight:bold}
It's possible to define "utility classes" and apply more than one
class to an element: <td class="a b c d e"> but browser support is
poor.
--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec:
http://www.w3.org/TR/html401/
validator:
http://validator.w3.org/
CSS 2 spec:
http://www.w3.org/TR/REC-CSS2/
2.1 changes:
http://www.w3.org/TR/CSS21/changes.html
validator:
http://jigsaw.w3.org/css-validator/