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 只在设置背景色时有效,很奇怪,为什么?


基础教程推荐
- npm start 错误与 create-react-app 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01