兼容各个浏览器的footer置底效果

源地址:http://ryanfait.com/resources/footer-stick-to-bottom-of-page/

 

key css:

    * {
    margin: 0;
    }
    html, body {
    height: 100%;
    }
    .wrapper {
    min-height: 100%;
    height: auto !important;
    height: 100%;
    margin: 0 auto -4em;
    }
    .footer, .push {
    height: 4em;
    }

 

html:

    <html>
        <head>
            <link rel="stylesheet" href="layout.css" ... />
        </head>
        <body>
            <div class="wrapper">
                <p>Your website content here.</p>
                <div class="push"></div>
            </div>
            <div class="footer">
                <p>Copyright (c) 2008</p>
            </div>
        </body>
    </html>

 

posted @ 2012-08-21 11:14  谁抢了我的刺猬  阅读(666)  评论(0编辑  收藏  举报