码迷,mamicode.com
首页 > Web开发 > 详细

html5 css练习 定位布局

时间:2018-10-08 21:34:48      阅读:566      评论:0      收藏:0      [点我收藏+]

标签:body   cti   lin   idt   pad   margin   title   doc   auto   

<!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{
    width: 960px;
    margin: 0 auto;
    position: relative;
}
header{
    width: 960px;
    height: 150px;
    background: rgba(0,0,0,0.3);
    
}
aside{
    width: 200px;
    height: 500px;
    background: rgba(200,20,20,0.8);
    
}
section{
    width: 760px;
    height: 500px;
    background: rgba(20,200,20,0.8);
    position: absolute;
    right: 0;
    top: 150px;
}
footer{
    width: 960px;
    height: 150px;
    background: rgba(60,60,60,0.6);    
}

 

html5 css练习 定位布局

标签:body   cti   lin   idt   pad   margin   title   doc   auto   

原文地址:https://www.cnblogs.com/houweidong/p/9757011.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!