hover on div does work in Firefox

ε祈祈猫儿з 提交于 2019-12-11 09:05:35

问题


I have this code:

<div title="" class="icePnlGrp graButtonActionDiv graButtonBackgroundOn">
       <label id="j_id89:j_id99" class="iceOutLbl graButtonActionLabel">Select</label>
</div>

With css:

.graButtonBackgroundOn {
line-height: 45px;
background:
    url('/resources/images/external/button_generic_on_txmart.png');

}

and

.graButtonBackgroundOn:hover{
background:
    url('/resources/images/external/button_generic_on_txmart-hover.png');

}

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.

Can you please give me a helping hand?

Thanks.


回答1:


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');
}

which will over write the original style rule



来源:https://stackoverflow.com/questions/6225969/hover-on-div-does-work-in-firefox

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!