I have situation like that
<section>
<div>On a hover change css here</div>
<a>Hover me</a>
</section>
I want to change css of div when a is hovered
.
Div have to be before a and there is no selector to select sibling that is before element.(related topic)
I also tried do do something like section:has(> a) >img
but :has() selector has very weak browsers support. (related topic)
Is there any way to do this thing in only css or using simple js?
(Stack is telling me that this question has been answered in this topic so here is the difference: In this topic the question is about existance of previous sibling selector and the answers aren't much helpful in this situation and in my question I ask about how to do this in this specific situation)