HTML + CSS 布局實現全屏布局



    * {
        margin: 0;
        padding: 0;
    }
    
    .contriner {
        width: 100%;
        height: 100%;
        background: red;
        position: relative;
    }
    
    .topBar {
        position: relative;
        width: 100%;
        height: 80px;
        background: blue;
        z-index: 2;
    }
    
    .asids {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 160px;
        padding-top: 80px;
        background: gold;
        z-index: 1;
    }
    
    .view {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        margin-top: 85px;
        margin-left: 165px;
        margin-right: 20px;
        margin-bottom: 20px;
        background: green;
        overflow-y: auto;
    }
    
    .content {
        width: 100%;
        height: 1000px;
        background: #fff;
    }


<div class="contriner">
    <div class="topBar">
        頭部
    </div>
    <div class="asids">
        側邊欄
    </div>
    <div class="view">
        <div class="content"></div>
    </div>
</div>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM