CSS和JSP的一些问题

来源:百度知道 编辑:UC知道 时间:2024/05/24 05:25:25
在编网页时,在网页底部和顶部各添加一幅图片,要水平重复的,用CSS怎么实现呢?
显示不出来啊

以下 实测通过

css文件中添加两个id定义

#top {background: url("[path2top]") repeat-x; width: 100%; height: [图片高度]px; }
#bottom {background: url("[path2bottom]") repeat-x; width: 100%; height: [图片高度]px; }

用顶部图片地址替换[path2top] 底部替换[path2bottom]
图片的高度的像素值替换[图片高度]
然后在<body>后添加
<div id="top">&nbsp;</div>

在</body> 前添加
<div id="bottom">&nbsp;</div>

注意 &nbsp; 的&要改成半角的& 因为baidu显示不出来我才改的全角

<div align="center" style=" background-image: url(顶部图片地址);background-repeat: repeat-x;"></div>
<div align="center" >中间内容<div>
<div align="center" style=" background-image: url(底部图片地址);background-repeat: repeat-x;"></div>

如果是.NET平台的呢,有个排列属性。