I'm trying to get something done purely in CSS.
<body>
<div class="box">
<div>Text</div>
<div>Text</div>
<div>Text</div>
</div>
<div class="box">
<div>Text</div>
<div class="selected">Text</div>
<div>Text</div>
</div>
<div class="box">
<div>Text</div>
<div>Text</div>
<div>Text</div>
</div>
</body>
Fiddle: http://jsfiddle.net/c4bmuxze/4/
I want to make all the DIVs following the "selected" one green. How do you accomplish this? How can you go back a step to a parent selector (e.g. ".box"), choose all the following siblings (via "~") and then go down to select the DIVs from them?
If all the DIVs were direct siblings this would be no problem at all, just this step to hop between parents is making this hard for me.
I'm hoping for some CSS guru or someone pointing out the obvious to me.