61,112
社区成员
发帖
与我相关
我的任务
分享
<!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>
</head>
<style type="text/css">
.header{ background-color:red; height:auto; width:400px; height:30px; line-height:30px; text-align:center;}
.left{ position:relative; float:left; width:100px; background-color:#00F; height:400px; text-align:center;line-height:400px;}
.main{ float:left; width:300px; background-color:#C66; text-align:center; line-height:400px;}
.footer{clear:both; width:400px; height:50px; background-color:#6CC; text-align:center; line-height:50px; }
</style>
<body>
<div style="margin-left:auto; margin-right:auto; margin-top:40px; width:400px; ">
<div class="header">头部</div>
<div class="content">
<div class="left">侧边</div>
<div class="main">主体</div>
</div>
<div class="footer">底部</div>
</div>
</body>
</html>
是这样么?