divhover背景颜色的变化?
我怎么能使它行动,如果一个div的行锚,所以当我徘徊它回到红色
CSS
.e { width:90px; border-right:1px solid #222; text-align:center; float:left; padding-left:2px; cursor:pointer; } .f .e { background-color:#F9EDBE; }
HTML
<div> <div class="e" >Company</div> <div class="e">Target</div> <div class="e" style="border-right:0px;">Person</div> </div> <div class="f"> <div class="e">Company</div> <div class="e">Target</div> <div class="e" style="border-right:0px;">Person</div> </div> <div> <div class="e">Company</div> <div class="e">Targetaaa</div> <div class="e" style="border-right:0px;">Person</div> </div> <div class="f"> <div class="e">Company</div> <div class="e">Target</div> <div class="e" style="border-right:0px;">Person</div> </div>
.e:hover{ background-color:#FF0000; }
如果您希望在添加:hover
伪:hover
时更改颜色
div.e:hover { background-color:red; }