CSS设计网页布局(1-3-1左右固定,中间动态)示例代码

<!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">
#header,#content,#footer{
 background-color:#ccc;
 border:1px solid #00C;
 height:50px;
 width:80%;
 margin:10px auto;
}
#content{
 height:500px;
}
#left{
 height:500px;
 width:100px;
 float:left;
 border:solid 1px #FF0;
 background-color:#33C;
}
#right{
 height:500px;
 width:100px;
 float:right;
 border:solid 1px #060;
 background-color:#303;
}
#center{
 height:500px;
 width:100%;
 float:left;
 margin-left:-208px;
 overflow:hidden;
}
#varcenter{
 height:500px;
 border:1px solid #000;
 margin-left:208px;
 background-color:#306;
}
</style>
</head>

<body>
<div id="header"></div>
<div id="content">
<div id="left">
</div>
<div id="center">
<div id="varcenter"></div>
</div>
<div id="right"></div>
</div>
<div id="footer"></div>
</body>
</html>

posted on 2011-11-04 09:56  李兰  阅读(410)  评论(0编辑  收藏  举报

导航