IE8: Div hover only works when background color is set, very strange, why?(IE8:Div hover 只在设置背景色时有效,很奇怪,为什么?)
问题描述
情况:有一个带有按钮图像的 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 只在设置背景色时有效,很奇怪,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:IE8:Div hover 只在设置背景色时有效,很奇怪,为什么?


- 如何显示带有换行符的文本标签? 2022-01-01
- 是否可以将标志传递给 Gulp 以使其以不同的方式 2022-01-01
- 使用 iframe URL 的 jQuery UI 对话框 2022-01-01
- 在不使用循环的情况下查找数字数组中的一项 2022-01-01
- 为什么我的页面无法在 Github 上加载? 2022-01-01
- 从原点悬停时触发 translateY() 2022-01-01
- 我不能使用 json 使用 react 向我的 web api 发出 Post 请求 2022-01-01
- 如何向 ipc 渲染器发送添加回调 2022-01-01
- 为什么悬停在委托事件处理程序中不起作用? 2022-01-01
- 如何调试 CSS/Javascript 悬停问题 2022-01-01