HTML
<div id="banner" style="display: block; background-image: url('images/swirl_home.gif'); background-repeat: no-repeat; background-color: #e7e7e7;">
<div id="Hi">
some text here...
</div>
<div id="loader">
<img src="images/ajax-loader.gif" />
</div>
</div>
CSS
#banner {
background-color: #e7e7e7;
min-height: 285px;
}
以上代码在 Mozilla 和 Chrome 中完美呈现。在 IE 6/7/8 中完全失败。背景图像只是不显示。虽然我可以看到文字。
我做错了什么......?
编辑:这不是图像路径的问题。我也尝试给出绝对路径。没用。
最佳答案
您需要在 #banner
CSS 规则中添加一个高度,因为您使用的是 IE 不支持的 min-height
放
height:auto!important;
height:285px;
min-height:285px;
它应该可以工作..
关于html - IE 中的背景图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2621446/