0

I wonder how I make my footer stick to the bottom as Stackoverflow's.

If I give it a position:absolute and bottom:0px; it stays at the same place. Nor I want a position:fixed; one.

I've been searching the web for a while now but I can't find the right solution. Thankful for every answear!

4 Answers4

0

You're probably looking for a sticky footer. You can find an example at CSS tricks

NielsPilon
  • 500
  • 2
  • 7
  • 21
  • Ok, thanks! I will accept the answear in 8 min. – Gabriel Lindgren Feb 03 '14 at 20:54
  • Currently this is a comment, not an answer. Answers are expected to contain enough information that they could stand alone. If you're going to include resources from a linked page, it's important to quote the relevant information so that the content is maintained if the link no longer works. – zzzzBov Feb 03 '14 at 20:55
  • Oh thanks for mentioning that as I'm still a StackOverflow answer newbie. Will keep it in mind for the next question. – NielsPilon Feb 03 '14 at 20:58
0

The simple answer would be to add the clear: both property to your CSS footer class.

aebmad
  • 1,390
  • 1
  • 15
  • 14
0

Please go through the links below for working Examples:

Example 1

Example 2

Example 3

   #footer {
    position: absolute;
    bottom:0;
    width: 100%;
    background-color:#CCC;
    color:#333;
    padding:20px;
}

Hope this helps.

zzzzBov
  • 174,988
  • 54
  • 320
  • 367
Jatin
  • 3,065
  • 6
  • 28
  • 42
0

You can try adding this css to the footer class:

HTML:

<div class="footer">
   <p>Copyright 2013</p>
</div>

CSS:

.footer{
width: 100%;
position:relative;
bottom: 0; //fixes the footer to the bottom of the page.
height: 80px;
}
RemusT
  • 166
  • 2
  • 10