将页脚放在底部

时间:2017-09-27 15:06:16

标签: html css

我需要在页面底部有一个页脚,但是当内容不足以到达页面底部时,页脚将位于页面底部。我可以用css做什么呢?我将从PHP加载数据,我需要知道如何使页脚位于页面底部(如果有足够的内容填满整个屏幕),或者在屏幕底部(如果没有足够的内容来填补scren)。

<!DOCTYPE html>
<html>
<head>
    <title>Maxheight</title>
</head>
<body>
<style type="text/css">
    * {
        padding:0;
        margin:0;
    }
    a {

    }
    .info {
        color:#fff;
    }
    .pp {
        color:green;
    }
    .footer {
        width:100%;
        height:100px;
        background-color: #2A515E;
        text-align:center;
        padding-top:50px;
    }
</style>
    <div>
        <a>Foo</a><br><br><br>
        <a>Foo</a><br><br><br>
        <a>Foo</a><br><br><br>
        <a>Foo</a><br><br><br>
        <a>Foo</a><br><br><br>
        <a>Foo</a><br><br><br>
        <div class='footer'>
            <a class='info'>Info...</a>
        </div>
    </div>
</body>
</html>

0 个答案:

没有答案