背景图像在IE6和IE7中不显示

背景图像在IE6和IE7中不显示

本文介绍了背景图像在IE6和IE7中不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3个div
HTML标记

 < div class =top-content-wrapper> ;< / DIV> 
< div id =content-wrapper>
< / div>
< div class =bottom-content-wrapper>
< / div>

应用CSS

  .top-content-wrapper {
background:url(img / white-box-top-bg.gif)no-repeat scroll left top transparent;
height:10px;
margin:0 auto;
padding:0 30px;
width:686px;
}
#content-wrapper {
background:url(img / white-box-middle-bg.gif)repeat-y向左滚动透明;
margin:0 auto;
padding:10px 25px 70px;
width:696px;
}
.bottom-content-wrapper {
background:url(img / white-box-bottom-bg.gif)no-repeat scroll left top transparent;
height:53px;
margin:0 auto;
padding:0 30px;
width:686px;





$ b在所有主流浏览器中,它的工作正常,但在IE6和iE7中,背景不是显示请帮助我。
谢谢。

解决方案

不确定,但它可能背景参数的错误顺序。排序它们的正确方法是这样的:

repeat-y scroll left top;



另外,正如Sam152在评论中所说的,可能是您没有内容在你的div中,所以它们不会在某些浏览器中显示。


I Have 3 divs HTML MARKUP

<div class="top-content-wrapper"></div>
<div id="content-wrapper">
</div>
<div class="bottom-content-wrapper">
</div>

Applied CSS on

.top-content-wrapper {
background:url("img/white-box-top-bg.gif") no-repeat scroll left top transparent;
height:10px;
margin:0 auto;
padding:0 30px;
width:686px;
}
#content-wrapper {
background:url("img/white-box-middle-bg.gif") repeat-y scroll left top transparent;
margin:0 auto;
padding:10px 25px 70px;
width:696px;
}
.bottom-content-wrapper  {
background:url("img/white-box-bottom-bg.gif") no-repeat scroll left top transparent;
height:53px;
margin:0 auto;
padding:0 30px;
width:686px;
}

In all major browsers its working fine but in IE6 and iE7 the background is not displaying please help me.Thank you.

解决方案

Not sure, but it may be that you have a wrong order of parameters for the backgrounds. The proper way to sort them is this one:

background: transparent url("img/white-box-middle-bg.gif") repeat-y scroll left top;

Also, as Sam152 said in the comments, it may be the case that you don't have content in your divs, so they won't show in some browsers at all.

这篇关于背景图像在IE6和IE7中不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 18:30