将鼠标悬停在div上确实可以在Firefox中工作 [英] hover on div does work in Firefox
本文介绍了将鼠标悬停在div上确实可以在Firefox中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有此代码:
<div title="" class="icePnlGrp graButtonActionDiv graButtonBackgroundOn">
<label id="j_id89:j_id99" class="iceOutLbl graButtonActionLabel">Select</label>
</div>
使用CSS:
.graButtonBackgroundOn {
line-height: 45px;
background:
url('/resources/images/external/button_generic_on_txmart.png');
}
和
.graButtonBackgroundOn:hover{
background:
url('/resources/images/external/button_generic_on_txmart-hover.png');
}
我不知道为什么在Firefox和IE上,将鼠标悬停在该div上不会更改背景图像....但是在Chrome上,它运行良好.
I cannot figure out why on Firefox and IE, hovering on that div does not change the background image.... But on Chrome it works perfectly.
你能帮我个忙吗?
谢谢.
推荐答案
尝试使:hover样式规则在其正常状态下更具特异性,所以:
Try giving the :hover style rule more specificity over its normal state, so:
.graButtonBackgroundOn {
line-height: 45px;
background:
url('/resources/images/external/button_generic_on_txmart.png');
}
div.graButtonBackgroundOn:hover{
background:
url('/resources/images/external/button_generic_on_txmart-hover.png');
}
这将覆盖原始样式规则
这篇关于将鼠标悬停在div上确实可以在Firefox中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文