61,112
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<title>一个简单的页面框架</title>
<style type="text/css" media="all">@import "layout.css";</style>
</head>
<body>
<div id="header">
<div class="logo">logo</div></div>
<div id="menu">
<ul>
<li>menu1</li>
<li>menu2</li>
<li>menu3</li>
</ul></div>
<div id="main">
<div class="sidebar">
<ul>
<li>sidebar1</li>
<li>sidebar2</li>
<li>sidebar3</li></ul></div>
<div class="content">content</div>
<div class="clear"></div></div>
<div id="footer">Information and copyright of this site</div>
</body>
</html>
/*File Name: Layout.css*/
body{
font-family:"宋体";
font-size:12px;
margin:0;
color:#000;
}
ul{
margin:0;
padding:0;
}
#header{
margin:0 auto;
width:780px;
height:70px;
border:#333 1px solid;
background:#999;
padding:10px 0 10px 20px;
}
.logo{
width:70px;
height:70px;
border:#333 1px solid;
background:#666;
color:#fff;
text-align:center;
}
#menu{
margin:3px auto;
padding:0 20px 0 0; /*使用补白属性控制菜单精确位置*/
width:780px;
height:30px;
border:#333 1px solid;
background:#666;
}
#menu ul{
float:right;
}
#menu ul li{
float:left; /*定义列表同行显示*/
list-style:none;
height:20px;
margin:4px 0 0 10px;
border:1px solid #fff;
color:#fff;
}
#main{
margin:0 auto;
width:780px;
border:1px solid red;
background:#666;
}
.sidebar{
float:left;
width:150px;
height:200px;
margin:5px 0 5px 5px;
background:#999;
border:1px solid yellow;
}
.sidebar ul{
margin:10px 0 0 20px;
}
.sidebar ul li{
margin:5px 0;
width:100px;
height:24px;
list-style:none;
color:#fff;
border:1px solid #fff;
}
.content{
float:right;
padding:10px 0;
width:610px;
height:300px;
background:#eee;
text-align:center;
}
#footer{
margin:3px auto;
width:780px;
padding:20px 0;
text-align:center;
background:#666;
border:#333 1px solid;
color:#fff;
}