internet-explorer-8 - IE8 中的分层背景

标签 internet-explorer-8 background css

background-image: url('/images/tenticles.png'), url('/images/header.png');

我有上面的代码,它可以在 Firefox 和 Chrome 中运行。但它在 IE8 中不起作用。我想知道是否有办法解决这个问题。类似于 HTML5shiv 的东西。

最佳答案

对于 IE 缺少 multiple background support 的情况,有多种解决方法。其中一种技术涉及简单地创建一个跨越整个页面的 div,并将其背景与 body 元素的背景一起设置。必要时可以重复该技术。例如:

body { background-url('/images/tenticles.png'); }
#background1 { background-url('/images/header.png'); }

<body>
    <div id="background1">
    </div>
</body>

但是,看起来您想要类似 CSS3 PIE (Progressive Internet Explorer) 的东西,它“使 Internet Explorer 6-8 能够呈现几个最有用的 CSS3 装饰功能”。来自 PIE 网站:

PIE currently has full or partial support for the following CSS3 features:

  • border-radius
  • box-shadow
  • border-image
  • multiple background images
  • linear-gradient as background image

Other features are under active development.

请注意this question非常相似,并且有很多其他有用的信息和技术。

关于internet-explorer-8 - IE8 中的分层背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5034735/

相关文章:

html - 填充文本填充溢出不影响分词

css - 保持 div 的宽度与 wrapper 相同,但使背景全宽

html - 背景图像渲染问题

jquery - 使用 jQuery 加载内容并追加元素

javascript - 禁用小屏幕模式

javascript - 烦人的 IE8 下拉问题在 XP 而不是 windows 7

html - IE 8/9 中的元素未按预期换行

css - 如何只打印页面的特定部分?

javascript - 使用 Angular js 删除 IE8 中的#params

javascript - 如何在IE中先加载js文件再加载html?