博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

底部固定,高度自动,跟随滚动条滚动

Posted on 2017-06-28 06:17  绝交  阅读(519)  评论(1编辑  收藏  举报

现在的样式,看起来简单,但里面深奥的东西太多,套路太多,还是自己不够聪明呀!!!

 

 

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <style type="text/css">
    html,
    body{
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        border: 0;
    }
    .a1{
        width: 100%;
        min-height: 100%;
        margin-bottom: -80px;
        background: #090;
        overflow: hidden;
    }
    .content{
        padding-top: 9999px;
        margin-top:  -9999px;
        background: #900;
        padding-bottom: 80px;
    }
    .a2{
        width: 100%;
        height: 80px;
        background: #009;
    }
    </style>
</head>
<body>
<div class="a1">
    <div class="content">
        test<br />
        test<br />
        test<br />
        test<br />
        test<br />
        test<br />
        test<br />
        <!-- test<br />
        test<br />
        test<br />
        test<br />
        test<br />
        test<br />
        test<br />
        test<br />
        test<br />
        test<br />
        test<br />
        test<br />
        test<br />test<br /> -->

    </div>
</div>
<div class="a2"></div>
</body>
</html>