html - IE8 样式背景 URL 图像

标签 html css internet-explorer-8

我在 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 选择器来保存我在上面定义的宽度和高度。

最佳答案

You have to check your doctype. Replace it with your loader doctype. In Quirks Mode, IE older version not support ":hover" on elements well, other than " tag".

<!DOCTYPE html>

If you like you can know about standard and Quriks mode HERE

关于html - IE8 样式背景 URL 图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19450394/

相关文章:

javascript - 时间选择器出现在模态后面

包裹在 anchor 中的 float 图像的 CSS 问题

javascript - 检查预览时 CSS 不工作

javascript - 无法从输入字段中获取日期并将其转换为 IE8 中的日期对象

css - IE8 不应用该样式,即使它的开发人员工具显示它

jquery - Paypal Cordova 插件 - IOS - Phonegap - '错误 : please make sure all fields have been entered;

css - 使 HTML5 视频海报与视频本身大小相同

来自远程服务器的 php 流文件

javascript - ExtJS 网页显示在 Chrome 切换设备模式和移动浏览器中不同

Javascript 和 Internet Explorer 8 错误