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:#369;
border:1px solid #336;
height:30px;
width:100%;
margin:10px auto;
}
#content{
height:500px;
}
#left{
height:500px;
width:30%;
border:1px solid red;
float:left;
background-color:#306;
}
#center{
height:500px;
width:49.42%;
float:left;
border:1px solid red;
background-color:#36F;
}
#right{
width:20%;
height:500px;
float:right;
border:1px red solid;
background-color:#336;
}
</style>
</head>
<body>
<div id="header"></div>
<div id="content">
<div id="left"></div>
<div id="center"></div>
<div id="right"></div>
</div>
<div id="footer"></div>
</body>
</html>