日期:2014-05-17  浏览次数:20643 次

页脚位置
有的时候页面的内容高度不够,但想要页脚靠在页面最下面,看到一个不错的解决办法,跟大家分享一下。
HTML code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <style type="text/css">
        *
        {
            margin: 0px;
            padding: 0px;
        }
        html, body
        {
            height: 100%;
        }
    </style>
</head>
<body>
    <div style="width: 100%; margin-bottom: -100px; background: #aa8; min-height: 100%;height: auto !important; height: 100%;">
        <h1>Hello World</h1>
        <div id="push" style="height: 100px;"></div>
    </div>
    <div id="footer" style="height: 100px; width: 100%; background: #fff;">
        this is the footer
    </div>
</body>
</html>




------解决方案--------------------
支持分享
------解决方案--------------------
谢谢分享
------解决方案--------------------
分享光荣!
------解决方案--------------------
支持分享!!