html5 css练习浮动布局


<!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: 100%;
    height: 960px;
}
header{
    height: 5%;
    background: rgba(25,25,25,0.25);
    
}

aside{
    width: 30%;
    height: 90%;
    background: orange;
    float: left;
    border: 1px solid green;
    box-sizing:border-box;
}
section{
    width: 70%;
    height: 90%;
    background: rgba(180,90,45,0.6);
    float: left;
}
footer{
    height: 5%;
    background: rgba(60,60,60,0.6);
    clear: left;
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM