/ Published in: CSS
URL: http://www.cssstickyfooter.com
Expand |
Embed | Plain Text
Sample HTML... <div id="wrap"> <div id="header"></div> <div id="main"></div> </div> <div id="footer"></div> ...and the CSS html, body {height: 100%;} #wrap {min-height: 100%;} #main {overflow:auto; padding-bottom: 150px;} /* must be same height as the footer */ #footer {position: relative; margin-top: -150px; /* negative value of footer height */ height: 150px; clear:both;} /*Opera Fix*/ body:before { content:""; height:100%; float:left; width:0; margin-top:-32767px;/ }
Comments
Subscribe to comments
You need to login to post a comment.

This is a neat trick. Thanks!