Considering:
HTML
<div id="div1">
<p>Elemento 1</p>
</div>
<div id="div2">
<p>Elemento 2</p>
</div>
How can I use :hover
in div1
to change style properties of div2
?
I tried the following, but to no avail:
CSS
#div2, #div1:hover {
background-color: white;
}
By the time the mouse goes into div1
, it works the way I want, but when it exits a problem arises: div2
continues with background-color: white
. What should I do (using CSS) to make the white background of div2
fade along with the white background of the other div?