首页 > Web开发 > 详细

html5 css练习 定位布局

时间:2018-10-08 21:27:49      阅读:244      评论:0      收藏:0      [点我收藏+]

<!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练习 定位布局

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!