【问题标题】:background-size before IE9IE9之前的背景大小
【发布时间】:2019-03-08 01:49:57
【问题描述】:

我有一些简单的 CSS,它使用属性 background-size 来强制背景填充页面。

body {
  background-attachment: fixed;
  background: url("/img/bg.jpg");
  background-size: cover;
}

由于不支持 background-size 属性,此代码在 Internet Explorer 8 及更低版本上中断。使用this polyfill code,可以在此代码中添加 IE8 支持。但是,代码在 IE7 及更低版本上仍然会中断。

有什么解决办法吗?

【问题讨论】:

  • 不要在 IE7 上浪费时间,它只有 0.01% 的用户。

标签: css internet-explorer cross-browser css-hack


【解决方案1】:

您可以使用AlphaImageLoader Filter 解决此问题。

另外,您可以查看与您的问题类似的这篇文章。 How do I make background-size work in IE?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-03-17
    • 1970-01-01
    • 2015-02-07
    • 2019-01-18
    • 2014-02-23
    • 1970-01-01
    • 2019-08-18
    • 1970-01-01
    相关资源
    最近更新 更多