0

There's are some pages in my website which content is little,

the content height + footer height < one screen height

See the picture below:

enter image description here

So my question is how can I make the footer at the bottom of the page when my content's height is not enough to cover the full page?

PS: I don't want the footer page fixed at the bottom.

Charles0429
  • 1,406
  • 5
  • 15
  • 31

2 Answers2

0

http://jsfiddle.net/yvZaV/1/

<div class="wrapper">
    <div>content here, this will push the footer down the page if it is needed</div>
    <footer>footer here</footer>
</div>

html, body {
    height:100%;
    min-height:100%;
}
.wrapper {
    position:relative;
    min-height:100%;
}
footer {
    position:absolute;
    bottom:0px;
    width:100%;
    background-color:red;
}
Anton
  • 7,709
  • 5
  • 31
  • 33
0

You can set min-height to your content, you can set it in pixels or in %

.content{
    min-height: 100%;
}

http://jsfiddle.net/yvZaV/2/

Vitim.us
  • 20,746
  • 15
  • 92
  • 109