【发布时间】:2015-01-22 16:15:24
【问题描述】:
我已将代码隔离到这些 div 图像交换。第二个图像闪烁,无论位置如何。我想不通?图像与菜单图像悬停状态基本相同。我的 IE8 代码有问题吗?
<div class="home"> </div>
<div class="image2"> </div>
这是 CSS:
.home{
background-image: url('home.png');
background-repeat:no-repeat;
}
.home:hover {
background-image: url('home_hover.png');
background-repeat:no-repeat;
}
.image2{
background-image: url('image2.png');
background-repeat:no-repeat;
}
.image2:hover {
background-image: url('image2_hover.png');
background-repeat:no-repeat;
}
第一张图片不闪烁。 CSS 是相同的,我可以重新定位 DIV 并获得相同的结果。为什么图像会闪烁?我是否也为其添加了高度或宽度属性似乎并不重要。
【问题讨论】:
-
为您的 DIV 提供固定尺寸,以像素为单位。
-
是的,他们有暗淡,我只是将其排除在外,因为这无关紧要。
标签: css image internet-explorer-8 flicker