分享

HTML + CSS 布局实现全屏布局

 怡红公子0526 2021-11-04

    * {
        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>

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约