0
If I have a #div1
and a #div2
, and they are brothers, I know I can use the dial ~
to stylize the #div2
as follows:
#div1:hover ~ #div2 { /* regras */ }
Is there an equivalent selector to style the #div2
when an event #div1:hover
occur in the following structure?
<div id="pai">
<div id="div1"></div>
</div>
<div id="div2"></div>
Not via CSS, the rules apply to own, children of his own or own brothers. What you want is if the son be with
:hover
, the uncle is "red". For this only Javascript.– Zuul
Prejudice with uncles :/ Vlw @Zuul
– Machado
Currently it is only possible if div2 is at the same div1 level, in your case div2 is not at the same level, and so it will not be possible to apply a CSS in div2 from div1. Fountain
– Don't Panic