Selectors express structural relationships between elements. When you ask for a selector for an element that is "outside" another element, you're looking for a combinator that says "this element appears outside the containing scope of this other element".
There is no such combinator.
You could conceivably select specifically the .outside
sibling of .parent
, but then you run into another problem that there is no parent selector for matching .parent
relative to .child:hover
like there is for matching .child:hover
relative to .parent
(that is, .parent > .child:hover
).
See also: How do I select an element based on the state of another element in the page with CSS?