I currently have CSS classes that are different but are for elements that have children of the same class (ChildClass
). I want to change the opacity of the child class when the parent classes are active. Right now I'm doing this with many CSS declarations (see example below). Can this be done with one declaration?
Current CSS
.class1 {
...elided...
}
.class2 {
...elided...
}
.class1:active .ChildClass {
...elided...
}
.class2:active .ChildClass {
...elided...
}
For both, the child class' change will be the same. Can I do something like this?
WHat I would like to do
.class1:active,class2:active .ChildClass {
...elided...
}
Will that work? What's the browser support for that?