I am trying to talk to a div that is not within the same wrapper as a div that I am hovering over. I am using the following code to change the background color of the div picture when the div home is hovered over and they are both within the div navBar:
.navBar .home:hover ~ div.picture {
background:#900; }
If I put home or picture within another div I am unable to access them.
Does anyone know how to get around this?
You won’t be able to reach elements that are not descendants or succeeding siblings from the element that’s being hovered with just CSS3 selectors. You’ll have to take the JavaScript route in order to do what you want with a different structure.