I have a css class like:
.foo {
background-color: red;
}
then I have a class specified for a list:
.list1 li {
background-c
No. The best you can do with "native CSS" is to use a multiple selector:
.foo, .list1 li {
...
}
Otherwise there are preprocessors that can help with this such as SASS.
Inheritance is, as far as I know, not supported in CSS (2.1 at least)
No you can't but you override it using naming differnt classes for example
.foo {
background-color: red;
}
.list1 li {
background-color: tan;
}
class ="list1 foo"
The above solutions aren't available if you don't have control over how 'foo' was defined.
So, if a JQuery solution is acceptable, just apply the original class to all instances of the new class/context. In this case:
$('.list li').addClass('foo')