【发布时间】:2013-10-18 21:44:56
【问题描述】:
我在 IE8 中悬停时遇到背景 url 问题。
对于其他浏览器和 IE9 可以正常工作,但在 IE8 中问题如下:
原始图像与悬停在其中的图像一起显示。
当我将鼠标悬停时,图像正在显示,但原始图像在那里。
无论如何都存在解决这个问题??
CSS:
#toTop {
position:fixed;
bottom:10px;
right:10px;
cursor:pointer;
display:none;
z-index:99999;
background:transparent url('original.png') no-repeat;
background-size:58px 59px;
width:58px;
height:59px;
}
#toTop:hover{
background:url('hover.png') no-repeat;
background-size:213px 59px;
width:213px;
height:59px;
}
html > body div#toTop {
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(
src='original.png',
sizingMethod='scale');
}
html > body div#toTop:hover{
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(
src='hover.png',
sizingMethod='scale');
}
我使用 css IE8 选择器来保存我在上面定义的宽度和高度。
【问题讨论】:
-
你能提供一个jsfiddle url来测试它吗?
-
@Apostolos jsfiddle 是否可以与 IE8 一起使用?
-
它只是为了测试那里有什么问题:)
-
@abhitalks - jsFiddle 的编辑器在 IE8 中不起作用,但您可以正常查看结果页面。或者,如果您需要带有可在 IE8 中运行的编辑器的工具,也可以使用 jsBin。
-
@Spudley 是的。谢谢。
标签: html css internet-explorer-8