Css mulitple class selector -
i trying select element multiple classes.
.parent1 .subparent2 .class1, .parent1 .subparent2 .class2, .parent1 .subparent2 .class3 { }
as
.parent1 .subparent2 .class1.class2.class3
to select element 3 classes doesn't work.
any idea how this?
what have works, if browser supports it, you can test here. here's test markup:
<div class="parent1"> <div class="subparent2"> <div class="class1 class2 class3">match</div> <div class="class1 class2">no match</div> </div> </div>
with current selector:
.parent1 .subparent2 .class1.class2.class3 { color:red; }
based on comments: clear, 2 selectors not equivalent, this:
.parent1 .subparent2 .class1, .parent1 .subparent2 .class2 ...
means child can have any of classes , match, this:
.parent1 .subparent2 .class1.class2.class3
means child has have all of classes match, serve different purposes.
Comments
Post a Comment