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/