CSS selectors only allow you to style a descendant element (space), a child element (>), an adjacent sibling (+) or a general sibling (~). It's not possible to express any other type of relation in CSS.
So for cases where you want to give a specific style to an element whose relation to the one that's being hovered can't be expressed with valid selectors, then you would have to use Javascript.
CSS selectors only allow you to style a descendant element (space), a child element (>), an adjacent sibling (+) or a general sibling (~). It's not possible to express any other type of relation in CSS.
So for cases where you want to give a specific style to an element whose relation to the one that's being hovered can't be expressed with valid selectors, then you would have to use Javascript.
TL;DR: in this case it's not possible with CSS.