I'm building a website where I want to hover on certain images and have them display other divs.
I found this JSfiddle which worked well. http://jsfiddle.net/ZSZQK/
<div id="image"><img src="image.png"/></div>
<div id="hover">Test message</div>
#hover {
display: none;
}
#image:hover + #hover {
display: block;
}
Only I need to split my divs up, meaning they are no longer adjacent, like this. http://jsfiddle.net/Z2H66/
<div class="first-container">
<div class="image"><img src="image.png"/></div>
</div>
<div class="second-container">
<div class="hover">Test message</div>
</div>
.hover {
display: none;
}
.image:hover + .hover {
display: block;
}
What tools are at my disposal that are able to do what I'm asking?
Also note I changed my code to classes rather than ids, but that doesn't stop it working. My code doesn't work because the div hover
and image
are not adjacent.