Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-10-2012, 12:57 PM   PM User | #1
YourDirector
Regular Coder

 
Join Date: Jul 2011
Posts: 116
Thanks: 6
Thanked 0 Times in 0 Posts
YourDirector is an unknown quantity at this point
Positioning Footer always at base

Hi all, got a bit of an issue with getting my footer to stick to the base of the page.

I have a Fixed Position header at the top of the page remaining visible at all times but then want the wrapper and main conent divs to expand with their contents and a 100%width footer at the base of that.

This is where I currently am:

Style:

Code:
body{
    height:100%;
    margin:0px 0px 0px 0px;
    }

#headerdiv{
  position:fixed;
  top:0px;
  left:0px;
  width:100%;
  height:125px;
  z-index:20000000;
}

#headerholder{
    position:fixed;
    width:100%;
    height:125px;
    z-index:30000000;
    text-align:center;    
    }
    


#wrapper{
   position:absolute;
   margin-top:125px;
   width:100%;
height:100%
   text-align:center;
   min-height:100%;
 }

#maincontent{
    position:relative;
    margin:0 auto;
    clear:both;
    width:870px;
    text-align:left;
min-height:100%;
    height:auto !important;
    height:100%;
 }

   #footerbar{
    position:relative;
   margin-top:-160px;
    width:100%;
    margin-top:-160px;
    height:160px;
}
Body:
Code:
<div id="headerdiv"> <!-- This is a semi-transparent background for the header -->
 &nbsp;
 </div>
 <div id="headerholder"><!-- This contains the headers contents -->
 HEADER CONTENT
</div>
 <div id="wrapper">

 <div id="maincontent">
PAGE CONTENT HERE
</div>
<div id="footerbar">
<div id="footercontent">
FOOTER CONTENT HERE
</div>
</div></div>
I just can't get this to work though. Could anyone point out where I may be going wrong? Thanks YD

Last edited by YourDirector; 04-10-2012 at 01:11 PM..
YourDirector is offline   Reply With Quote
Old 04-10-2012, 06:51 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,362
Thanks: 18
Thanked 347 Times in 346 Posts
sunfighter is on a distinguished road
It's called sticky footer, google it.
sunfighter is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:34 AM.


Advertisement
Log in to turn off these ads.