#myUserMenu {
position: absolute;
background-color: white;
top: 20px;
width: 116px;
border: 1px solid #CCC;
}
#myAvatar:hover #myUserMenu {
background-color: red;
}
.menuItem {
cursor: pointer;
border-bottom: 1px solid #EEE;
}
<img id='myAvatar'>some text here...
<div id="myUserMenu">
<div class='menuItem'>Status online</div>
<div class='menuItem'>Status offline</div>
</div>
So when I hover the myAvatar, myUserMenu background should change to red
#myAvatar:hover #myUserMenu
And nothing happens ! Any idea why ?