【发布时间】:2014-08-22 01:53:36
【问题描述】:
我有一个空 div,其中包含一个大于容器大小的背景图像。我通过background-image 属性修复了这个值(100% 100%)。这很好,直到您在 IE8 和 IE7 中打开示例。任何解决方案,甚至是 javascript 脚本或 jquery 插件?
即:http://jsbin.com/imirer/1/edit
HTML:
<div class="container">
<div class="background"></div>
</div>
CSS:
.container {
/* an example width for responsive perpose */
width: 500px;
}
.background {
height: 27px;
background: url("http://s18.postimage.org/jhbol7zu1/image.png") no-repeat scroll 100% 100% transparent;
/* not working in IE8 and IE7 */
background-size: 100% 100%;
}
【问题讨论】:
-
IE7-8 不支持 background-size 属性,见:caniuse.com/background-img-opts
-
我认为这是同一个问题:stackoverflow.com/questions/2991623/…
-
为什么要用div里面的div来设置背景?希望你知道这没有任何意义?
-
我为一个小型设备 MarcinWolny 制作了容器 div
-
我知道不支持 darma,但我需要一些 JS 解决方案
标签: css internet-explorer cross-browser