In HTML, I have an ordered list with some list items. When hovering, an item I want that all items below it to become blue and all items above (including the hovered one) to become red.
I was able to do the first part, but not the second part. Thank you!
ol li:hover~li {
color: blue;
}
<ol>
<li>Text</li>
<li>Text</li>
<li>Text</li>
<li>Text</li>
<li>Text</li>
<li>Text</li>
</ol>