I feel dumb for having been a web programmer for so long and not knowing the answer to this question, I actually hope it\'s possible and I just didn\'t know about rather tha
No you can't do something like
.composite
{
.something;
.else
}
This are no "class" names in the OO sense. .something
and .else
are just selectors nothing more.
But you can either specify two classes on an element
...
or you might look into another form of inheritance
.foo {
background-color: white;
color: black;
}
.bar {
background-color: inherit;
color: inherit;
font-weight: normal;
}
Where the paragraphs backgroundcolor and color are inherited from the settings in the enclosing div which is .foo
styled. You might have to check the exact W3C specification. inherit
is default for most properties anyway but not for all.