我的代码不起作用。我发现这是因为必须更改的 div 在另一个 div 中......如何绕过包含其他 div 的 div?在此示例中,我希望在悬停“partage”div 时更改“partagefb”div 的背景颜色
演示:http: //jsfiddle.net/u7tYE/1994/
谢谢
html:
<div class="partage" id="partage_70"><img src="/themes/glace_et_ombre/images/partage.png" border="0" width="22" height="21"></div>
<div class="enveloppe_partage">
<div class="partagefb"></div>
</div>
CSS:
.partage{
position:relative;
float:left;
margin: 2px;
cursor:pointer;
z-index: 100;
width:20px;
height:20px;
}
.partagefb{
position:relative;
width: 25px;
height: 25px;
margin:100px;
background: #ccc;
}
.partage:hover ~ .partagefb{
background-color:#000000;
}
.enveloppe_partage{
position: absolute;
margin: -28px 0 0 115px;
}