tangsix
2010-05-09 19:46
怪,为什么里面元素的背景图被外面元素的背景图所覆盖掉了
按道理说,里面元素的背景图应该叠放在外面元素背景图的上方,但有代码如下:
<div id="title"><h2>公司简介</h2></div>
#title {
margin:16px 0 0 5%;
background:url(images/bj.jpg) repeat-x;
width:90%;
height:41px;
}
#title h2 {
text-indent:-9999px;
background:url(images/ggd.jpg) no-repeat;
margin:0px;
}
该网页在ie6中浏览正常,但是在Firefox ,Safari,Opera中,h2的背景图片居然被#title的背景图片覆盖掉了下半部分,(请注意“公司简介”几个字的图片下半部分被#title的背景遮盖掉)不知是何故哦。为什么呢?下面是该网页的地址,请用不同浏览器浏览。盼高手解答。
http://ec.hynu.cn/shili41/index-css.html
按道理说,里面元素的背景图应该叠放在外面元素背景图的上方,但有代码如下:
<div id="title"><h2>公司简介</h2></div>
#title {
margin:16px 0 0 5%;
background:url(images/bj.jpg) repeat-x;
width:90%;
height:41px;
}
#title h2 {
text-indent:-9999px;
background:url(images/ggd.jpg) no-repeat;
margin:0px;
}
该网页在ie6中浏览正常,但是在Firefox ,Safari,Opera中,h2的背景图片居然被#title的背景图片覆盖掉了下半部分,(请注意“公司简介”几个字的图片下半部分被#title的背景遮盖掉)不知是何故哦。为什么呢?下面是该网页的地址,请用不同浏览器浏览。盼高手解答。
http://ec.hynu.cn/shili41/index-css.html