To get this effect, you can use a common combinator (~) and a div with an absolute position. In this example, you should select a div with the class ".bgr" that will appear after the child hangs and make it pink / blue.
#wraper { position:relative; width:200px; height:200px; } .bgr { position:absolute; top:0; left:0; width:100%; height:100%; background:#fff; padding:30px; } #left, #right { position:relative; z-index:1; width:200px; height:100px; border:1px solid #333; margin:20px; } #left{ background:#fff; } #right{ background:#f1f1f1; } #left:hover { background:#f9f9f9; } #right:hover { background:#f9f9f9; } #left:hover ~ .bgr { background:blue; } #right:hover ~ .bgr { background:pink; }
<div id="wrapper"> <div id="left"> ... some elements </div> <div id="right"> ... some elements </div> <div class="bgr"></div> </div>
source share