I can use the adjacent selector like this:
/* When c and c are adjacent, color the second c red */
.c + .c {
background-color: red;
}
但是,当“.c”被nes时,如何做同样的事情?
<div class="a">
<div class="b">
<div class="c"></div>
</div>
</div>
<div class="a">
<div class="b">
<div class="c"></div>
</div>
</div>
/* Does not work */
.a .b .c + .a .b .c {
background-color: red;
}