views:

15

answers:

1

Hi, I am using this site.

Aim :
I want to move my footer based on the content of every page.

1)If there is more content then i want to put my footer after the content.
2)I want to fix the footer to the bottom of the window screen, if there is no content like this in the following picture

alt text

My existing CSS :

I am currently using min-height property in #content to keep the footer at the bottom.

#footer_outer{
    width:100%;
    background:#444;
    padding:10px 0 0 0;
    margin-top:50px;
    height: 130px;
}

#footer {
    margin:0 auto;
    width:834px;
    height:auto;
    overflow:hidden;
}

#content {
    padding:5px;
    margin:0 auto;
    width:890px;
    height:auto;
    min-height:450px;
}

body {
    font-family:'Helvetica Neue', helvetica, arial, sans-serif;
    color:#757575;
    font-size:14px;
    padding:0;
    margin:0;
    background:#FAFAFA;
}

Please help me in achieving my aim. Thanks a lot in advance.

regards, vaths

A: 

1. Use fixed position divs

http://www.dailycoding.com/Posts/creating_always_visible_div_using_css.aspx

Change CSS to

#footer {
    margin:0 auto;
    width:834px;
    height:auto;
    overflow:hidden;
    position: fixed;
    bottom: 0px;
}

2. How to keep footers at the bottom of the page

http://matthewjamestaylor.com/blog/keeping-footers-at-the-bottom-of-the-page

Ramesh Soni
Thanks for your swift response. I tried your solution. But, that puts my footer always at the bottom of my window screen irrespective of the content. So the footer hangs in the middle and some content is hidden behind the footer. What I want to achieve is : 1) If there is not much content on a particular screen (that is if the content does not bring in any scroll bars), then i would like to fix the footer at the bottom of my window.2) If there is a lot of content and scroll bars are present as well, then I want the footer at the end... beneath the last word of the content..THANKS
@vatismarty, checkout http://matthewjamestaylor.com/blog/keeping-footers-at-the-bottom-of-the-page
Ramesh Soni