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:50%;
 float:left;
 margin-left:-50px;
 overflow:hidden;
}
#right{
 height:500px;
 width:49.5%;
 float:right;
 margin-right:-50px;
 overflow:hidden;
}
#center{
 height:500px;
 border:1px red solid;
 width:100px;
 float:left;
 background-color:#0F9;
}
#varleft{
 height:500px;
 border:1px solid #000;
 margin-left:50px;
 background-color:#390;
}
#varright{
 height:500px;
 border:1px solid #000;
 margin-right:50px;
 background-color:#36F;
}
</style>
</head>

<body>
<div id="header"></div>

<div id="content">
    <div id="left">
    <div id="varleft"></div>
     </div>
    
     <div id="center"></div>
    
    <div id="right">
    <div id="varright"></div>
    </div>
</div>

<div id="footer"></div>
</body>
</html>

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

导航