How to keep bottom section (footer) at the very bottom of web page

arendt73
arendt73 used Ask the Experts™
on
I am having issues keeping the footer section of my page at the very bottom.  If I increase the screen resolution, the footer does not stay at the bottom, and white appears underneath. I want the footer to always remain on the bottom.  How can this be done?

I've included my demo page for review.  The footer right now is a light blue (#0099FF) and the height will be set to 80.

My demo page contains my style sheet at the very top.

Please advise with mofications to the code how this can be done.  Thank you!

demo.htm
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2013

Commented:
You are not going to control much of anything using a 20th design like that.  Other than the style sheet that page lookslike something from 1999.

You don't have a valid doctype so you will get cross browser issues.  You are using depreciated attributes that could break the page, and you have everything tied together in layout defined with a table.  You have no control over the footer, or anything else on the page. The table properties determine the position of everything, and the positions will modify with changes in the screen.

You need to come into this century if you want to use modern techniques and support modern browsers.


Cd&

Author

Commented:
COBOLdinosaur, thanks for your "kind" words.  A suggestion would've been nice. Thanks for the support I paid.
Top Expert 2013

Commented:
What you paid for was access to information. What you got was information.  If you don't like the information then take it up with the company. I'm a volunteer on this site.  I don't work for the company, and I don't work for you.

As for a suggestion, you got one; modernize the page so it has some chance of supporting what you want to do.


Cd&
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
What is modernization to you? Use of layers as opposed to tables?
Top Expert 2013

Commented:
Modernization means standards driven design and development.  The use of a valid doctype to tell the browser what standard to use.  The removal of depreciated tags like font and depreciated attributes like bgcolor; instead moving presentation fully to CSS.  The use of semantically correct tags to define what content is.  It may be that part of the content of the page belongs in a table; if it is tabular data. Obviously the footer does not belong in a table.

With a modern page, layout is manage and control with CSS not HTML, and it might be possible to get the footer where you want it with fix position.  But fix position is most certainly not going to work, in the page you have, in a consistent manner cross browser; or cross version.  Even with a modern page sticking a footer to the bottom is a dicey proposition, because user settings can still break the page.


Cd&
Top Expert 2011
Commented:
Shamelessly stolen from FB's "Chat" box which is docked at the bottom right of my browser.
Works in FF8, Opera 11.6, and Chrome 16
Does not work in IE8
having issues with my Safari 5.1.2 opening.. so not tested there.

Add to your styles
#dockedFooter{
    bottom: 0;
    direction: ltr;
    height: 80px;
    left: 0;
    position: fixed;
    right: 0;
    z-index: 300;
    width:100%;
    text-align:center;
    background-color:#0099FF;
}

Open in new window


remove your existing table row for your footer and add this after your table:
<div id="dockedFooter">Footer content goes here</div>

Open in new window

Top Expert 2011

Commented:
Safari 5.1.2 finally opened... verified code above works there too (all Windows XP BTW)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial