I've been banging my head against this for a couple hours now. Maybe it can't be done, maybe I've missed something obvious.
I need to highlight the li I'm hovering over, and each li after that but not before, and only if I'm also hovering over a specific child of that li.
So in the code example, if I hover over the second li's div.doAThing, the second through to last li should highlight. I'm not sure how to get the selection working.
li
{
background-color: #3e3e3e;
}
li:hover, li:hover ~ li
{
background-color: #aaf500;
}
<ul id="theList">
<li>
<div>Data</div>
<div>One</div>
<div class='doAThing'>All</div>
</li>
<li>
<div>Data</div>
<div>One</div>
<div class='doAThing'>All</div>
</li>
<li>
<div>Data</div>
<div>One</div>
<div class='doAThing'>All</div>
</li>
<li>
<div>Data</div>
<div>One</div>
<div class='doAThing'>All</div>
</li>
</ul>