CSS cannot do this. CSS is designed to be read in turn and very fast, so logic is not something that should be done in CSS.
With this you can do this:
.some_element:hover #child_div { background-image: url('path/to/img.jpg'); }
Iff your HTML is like this:
<div class="some_element"> <div id="child_div">Hello</div> </div>
This works because the selector matches the #child_div owned by :hover ed .some_element .
If you plan to use jQuery, this skeletal code will do the job:
$('#trigger').hover(function() { $('#some_element').css('background-image', 'url("foo.png")'); }, function() { $('#some_element').css('background-image', 'url("bar.png")'); });
source share