For the Love of My Country

Andy Moore's web-development blog: HTML, CSS, JavaScript, Flash (subscribe)
quicklinks: html codes | w3 schools (CSS) | colour codes | archives
blogging at: Star Studded Super Step on politics, abortion, freedom...
How To: Float Objects at bottom of page
Thursday, November 5, 2009, 1:16 AM
How do you get a div, image, or text to sit at the bottom of the webpage, no matter what the size of your viewer's browser window or resolution? http://ryanfait.com/sticky-footer/ has the answer, and it involves a pretty straight-forward hack. Essentially what it does is, you put all your content inside one div, "wrapper" - apart from the content you want in your footer. The "wrapper" div is given a negative bottom margin of the exact height of your footer. And of course your footer sits underneath with that specified height. That's the trick. You can't use position:absolute or fixed, and you can't float:bottom. You need to just get a handle on this nifty little bit of code and then you'll be away and laughing.

Check out their code and then do it yourself, just modify your existing divs...

Labels: ,

Comments: Post a Comment

Subscribe to Post Comments [Atom]





<< Home
Archives: \April 2007/\June 2007/\September 2007/\August 2008/\September 2008/\October 2008/\December 2008/\February 2009/\March 2009/\May 2009/\July 2009/\August 2009/\September 2009/\October 2009/\November 2009/\December 2009/\January 2010/\February 2010/\March 2010/\August 2010/\September 2010/\December 2010/