<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>浮动布局</title>
<link rel="stylesheet" type="text/css" href="st1.css">
</head>
<body>
<header>头部内容</header>
<aside>侧栏导航</aside>
<section>主体内容</section>
<footer>底部</footer>
</body>
</html>
/*定位布局*/
*{
margin: 0;
padding: 0;
}
body{
960px;
margin: 0 auto;
position: relative;
}
header{
960px;
height: 150px;
background: rgba(0,0,0,0.3);
}
aside{
200px;
height: 500px;
background: rgba(200,20,20,0.8);
}
section{
760px;
height: 500px;
background: rgba(20,200,20,0.8);
position: absolute;
right: 0;
top: 150px;
}
footer{
960px;
height: 150px;
background: rgba(60,60,60,0.6);
}