【问题标题】:background bug in IE8 when css box shadow is applied应用 css 框阴影时 IE8 中的背景错误
【发布时间】:2012-03-27 22:21:50
【问题描述】:

我创建了一个带有背景图像的 DIV,并在其周围应用了盒子阴影效果。但是在 IE8 中,阴影出现在 DIV 内的内容上,而不是 DIV 本身。

只有当DIV上有背景时才会出现此错误,如果没有背景,框就可以了。

这是我的示例构建: http://jsfiddle.net/C9V2N/2/

【问题讨论】:

  • 它实际上发生在background-image - 如果你应用background-color 它工作正常。

标签: internet-explorer-8 filter css


【解决方案1】:

您必须像这样拆分 IE 与 Chrome 或 FF 的解释方式不同的属性:

#test {
    background-image: url('http://placehold.it/100x100');
    background-repeat: no-repeat;
}

http://jsfiddle.net/C9V2N/21/

希望对你有帮助。

艾美式。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-06-18
    • 2012-10-17
    • 1970-01-01
    • 1970-01-01
    • 2011-10-03
    • 1970-01-01
    • 2021-06-24
    相关资源
    最近更新 更多