css上下兩欄佈局(上欄固定 下欄自適應)

1.效果圖

<html>

<head>
    <title>上下兩欄佈局(上部固定,下欄自適應)</title>
    <meta charset="utf-8">
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        html,body{
            height: 100%;
        }
    </style>
</head>

<body>
    <section class="layout">
        <style>
         .layout{
             height: 100%;
         }
         .layout .left-content .top{
             width: 100%;
             height: 60px;
             background-color: aqua;
         }
         .layout .left-content .content{
             position: absolute;
             top: 60px;
             bottom: 0px;
             width: 100%;
             overflow: auto;
             background-color: red;
         }
        </style>
        <article class="left-content">
            <div class="top"></div>
            <div class="content">
                <h1>中間自適應</h1>
            </div>
        </article>
    </section>
 
</body>

</html>
<!-- <script src="../js/jquery.min.js"></script> -->
<script>



</script>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章