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
- 在for循环中使用setTimeout 2022-01-01
- 角度Apollo设置WatchQuery结果为可用变量 2022-01-01
- 有没有办法使用OpenLayers更改OpenStreetMap中某些要素 2022-09-06
- Karma-Jasmine:如何正确监视 Modal? 2022-01-01
- 在 JS 中获取客户端时区(不是 GMT 偏移量) 2022-01-01
- 当用户滚动离开时如何暂停 youtube 嵌入 2022-01-01
- 我什么时候应该在导入时使用方括号 2022-01-01
- 响应更改 div 大小保持纵横比 2022-01-01
- 动态更新多个选择框 2022-01-01