情况:有一个带有按钮图像的 div.div 需要在悬停时淡入.适用于除 Internet Explorer 之外的所有浏览器.当我给 div 一个背景颜色时,它突然起作用了.
Situation: Got a div with buttons images. Div needs to fadeIn on hover. Works in all browsers, except Internet Explorer. When I give the div a background color it suddenly works.
检查:http://ListAndPlay.com,左上角是控件.
Check: http://ListAndPlay.com , top left are the controls.
悬停在IE中不起作用,尝试为#buttons添加背景颜色,它突然起作用了.
The hover won't work in IE, try to add a background color to #buttons and it suddenly works.
问题:这是什么原因?如何正确解决这个问题?
Question: What is the reason for this? How to fix this properly?
我最近也遇到了这个问题.我还通过向悬停元素添加 1 x 1 px 透明背景图像来解决它.之后我想洗个澡.
I recently ran in to this problem also. I also solved it by adding a 1 by 1 px transparent background image to the hover element. I felt like taking a shower afterwards.
这篇关于IE8:Div hover 只在设置背景色时有效,很奇怪,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!