Hello and thank you all for taking a look in my problem: Here what i have :
#div1 {
background: red;
width: 200px;
height: 200px;
}
#div2 {
background: blue;
width: 200px;
height: 200px;
}
<div id="div1"></div>
<div id="div2"></div>
Now i wanna change div2's background into green by hovering div1, how do i do this only with css?
Update: i have a same question but another story:
--HTML--
<div id="div1"></div>
<div id="wrapper">
<div id="div2"></div>
</div>
--HTML--
--CSS--
#div1 {
background: red;
width: 200px;
height: 200px;
}
#div2 {
background: blue;
width: 200px;
height: 200px;
}
#wrapper{
width:500px;
height:500px;
}
--CSS--
Figured :
#div1:hover + #wrapper #div2{
background:green;}
for some reason idk why #div1:hover + #div2 doesnt work