zoukankan      html  css  js  c++  java
  • div height 自适应高度 占满剩余高度的方法

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <style>
            html,
            body {
                margin: 0;
                padding: 0;
                height: 100%;
            }
            .if-top {
                display: block;
                border: none;
                width: 100%;
                height: 120px;
            }
            .if-menu {
                width: 20%;
                height: 100%;
                border: none;
            }
            .if-content {
                width: 78%;
                height: 100%;
                border: none;
            }
    
            .div-outer {
                height: 100%;
                box-sizing: border-box;
                padding-top: 100px;
            }
    
            .div-top {
                background-color: burlywood;
                height: 100px;
                margin-top: -100px;
            }
            .div-content {
                background-color: #8ddad3;
                height: 100%;
            }
        </style>
    </head>
    <body>
        <div class="div-outer">
            <div class="div-top">
                你好
            </div>
            <div class="div-content">
                世界
            </div>
        </div>
        <!--<iframe class="if-top" src="top.html"></iframe>-->
        <!--<iframe class="if-menu" src="menu.html"></iframe>-->
        <!--<iframe class="if-content" src="content.html"></iframe>-->
    </body>
    </html>

    这个方法挺好的

  • 相关阅读:
    图像功率结合
    三星(多星)模型
    双星模型
    卫星变轨问题
    桌面木块弹簧
    球——绳模型、球——杆模型
    汽车拐弯问题
    圆锥摆模型
    省队集训日记
    NOI前比赛经验总结
  • 原文地址:https://www.cnblogs.com/jimaojin/p/7504069.html
Copyright © 2011-2022 走看看