css中两张背景图片分别置顶和置底该怎样编辑?

来源:百度知道 编辑:UC知道 时间:2024/06/01 09:44:45
做页面时我需要在顶部和底部分别设置一张背景图片,在body中只能编辑一张,或置顶或置底,请问哪位高手能告诉另一张该怎样设置?

body{background:url() center top;}
.bg{background:url() center bottom;}

<body>
<div class="bg">
这里放你页面的内容
</div>
</body>

<body>
<div class="wrap">
……
</div>
</body>
将图片分别放在body和wrap里。

那用两个div比较好,后期维护和修改都很方便的.
.top
{
width:1000px;
margin:0 auto;
backgroudn:url(images/xxx.jpg) no-repeat 0 0;
}
.footer
{
clear:both;
width:1000px;
margin:0 auto;
backgroudn:url(images/xxxx.jpg) no-repeat 0 0;
}

无解,可以定义一张为body的背景,另外一张装在其他容器里,或者直接两个都装在容器里。