For example I have a CSS class:
.class1 {background-color: red;}
But when this class is nested inside a defined (somewhat large) set of divs with ID in (#div1, #div2, #div3) I need some special styling..
Currently I'm accomplishing it like this:
#div1 .class1, #div2 .class1, #div3 .class1 {border: 1px solid;}
I would like to know if there is any way to not have to list out the class each time as the selector is getting very large due to the long selector. So in psudocode:
ANY(#div1, #div2, #div3) Sub Element .class1 {border : 1px solid;}
The example makes the question seem pretty moot but in reality has much more impact.
Thanks!
EDIT: I don't have total control of the HTML code as it will be coming from a 3rd party via Ajax. Also, I will need to support all major browsers including IE8.
#span1 .class1{ styling}#div1, #div2 { .class1 { ... } }