码迷,mamicode.com
首页 > 其他好文 > 详细

div height 自适应高度 占满剩余高度的方法

时间:2017-09-11 12:27:37      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:tle   url   pad   round   menu   lock   --   body   code   

<!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>

这个方法挺好的

div height 自适应高度 占满剩余高度的方法

标签:tle   url   pad   round   menu   lock   --   body   code   

原文地址:http://www.cnblogs.com/jimaojin/p/7504069.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!