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