首页 > 移动平台 > 详细

移动端尾部和头部固定

时间:2017-10-20 19:42:47      阅读:345      评论:0      收藏:0      [点我收藏+]
<!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>

  

移动端尾部和头部固定

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!