网页上下背景不同如何制作

来源:百度知道 编辑:UC知道 时间:2024/06/23 14:47:09
就是说页首和页脚的背景图片不一样,且页脚的背景要超过页脚部分到container里,比如中间白色,上下灰色
背景是这个样子的,但页面的高度不能固定,有什么好的解决方法没?

用下面这种方法来实现, 具体div的高度你自己设置, 还有图片的路径设置也需要你去设置, 反正结构已经给你了, 你不会说看不懂吧 :)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
.topbg{background:url(images/topbg.gif) repeat-x left top}
.botbg{background:#fff url(images/botbg.gif) repeat-x left bottom}
</style>
</head>

<body class="botbg">
<div class
<div class="topbg">header</div>