Footer postitioning problems (not as easy as you think)
-
Hi, I’ve been developing my new theme on my local server (hence not able to give you a link to it) and I am almost done but I am having a problem with the footer and it’s driving me nuts.
I want the footer to always be at the bottom of the page but, here’s where it gets tricky…
If the page content is too small to fill a full page I would like the page to “fill out” to 100% so the footer finds itself at the bottom of the browser window when it would otherwise not have been. And if the page is longer than the browser window I just want the footer to tag onto the bottom of the content.
A bit like wrapping something in a table which is set to 100% height, the bottom of the table is always at the bottom of the screen regardless of the contents length.
It’s not as easy as you might think though. I have tried changing the CSS for the footer to make the position:fixed; and tell it to stick to the bottom. While this works it means that if the content of the blog is longer than that it carries on under the footer and you have to scroll down the page with the footer covering content. It also breaks the background colour of the page which only shows up to where the footer would normally be tagged on – I want this to extend to the footer at the bottom.
Using position:relative; just tags the footer on as normal. Using absolute just makes it appear at a given location on the page permanantly no matter the length of content.
I have also tried using the min-height and height attributes but no luck there either.
Any ideas? I am tearing my hair out and figured somebody here must have done something like this…
- The topic ‘Footer postitioning problems (not as easy as you think)’ is closed to new replies.