码迷,mamicode.com
首页 > 移动开发 > 详细

移动端尾部和头部固定

时间:2017-10-20 20:04:24      阅读:627      评论:0      收藏:0      [点我收藏+]

标签:cal   head   log   scale   line   com   ble   splay   text   

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        
        html,
        body {
            height: 100%;
        }
        
        .wrap {
            display: -webkit-box;
            display: -webkit-flex;
            display: -ms-flexbox;
            display: flex;
            -webkit-box-orient: vertical;
            -webkit-flex-direction: column;
            -ms-flex-direction: column;
            flex-direction: column;
            width: 100%;
            height: 100%;
        }
        
        .header,
        .footer {
            height: 40px;
            line-height: 40px;
            background-color: #D8D8D8;
            text-align: center;
        }
        
        .main {
            -webkit-box-flex: 1;
            -webkit-flex: 1;
            -ms-flex: 1;
            flex: 1;
            width: 100%;
        }
    </style>
</head>

<body>
    <div class="wrap">
        <div class="header">header</div>
        <div class="main">
            弹性滚动区域
        </div>
        <div class="footer">footer</div>
    </div>

</body>

</html>

  

移动端尾部和头部固定

标签:cal   head   log   scale   line   com   ble   splay   text   

原文地址:http://www.cnblogs.com/chenmeng1314/p/7700913.html

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