Fiddle: http://jsfiddle.net/Lnrn97a7/2/
HTML:
<div id="outer">
<div class="c1">
c1 should be black
</div>
<div class="c2">
c2 should be black
</div>
<div class="c3">
c3 should be black
</div>
</div>
<div id="somethingelse">
<div class="c1">
c1 should be red
</div>
<div class="c2">
c2 should be red
</div>
<div class="c3">
c3 should be red
</div>
</div>
CSS:
:not(#outer) .c1 {
color: #ff0000;
}
div:not(#outer) .c2 {
color: #ff0000;
}
:not(#outer) > .c3 {
color: #ff0000;
}
With c1, I have a descendant rule that does not include the parent element type. With c2, I have a descendant rule that does include the parent element type. With c3, I have an immediate child rule that does not include the parent element type. Only c2 and c3 work as intended. Why?