• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 394
  • Last Modified:

Why isn't this footer staying at the bottom?

Here's my stylesheet:

   position:absolute;
   bottom:0;
   width:100%;
   height:35px;   /* Height of the footer */
   background-color:#000000;
   position:fixed;
   }

It works great as long as I have a decent amount of content at the top of the page. But in those instances where the content is minimal, the footer tends to creep up to the middle of the page.

How can I fix that so regardless of how much content is on the page, the footer will always stay at the bottom?
0
brucegust
Asked:
brucegust
  • 2
  • 2
2 Solutions
 
GaryCommented:
0
 
LZ1Commented:
Can you post a live link? You may have other stuff going on that we can't see in just your CSS.
0
 
GaryCommented:
The problem is that code will never work, the trick in the link works in all browsers.
0
 
LZ1Commented:
Also you can't have 2 position declarations in the CSS. You have position:absolute and position:fixed. Choose only 1
0
 
brucegustAuthor Commented:
This worked:

#footer {
   position:absolute;
   margin-top: -35px;
   bottom:0;
   width:100%;
   height:35px;   /* Height of the footer */
   background-color:#000000;
   clear:both;
   }

Thanks!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now