joshua
joshua

Reputation: 2371

Set the height of a master page to cover all resolutions

I'm trying to set the height of a master page for any screen resolution.

I want to only fill the whole body area of the screen with the content page. Hardcoding the height is not a good way because:

  1. Content pages vary in height
  2. There is a footer at the bottom of the master page

Upvotes: 1

Views: 2272

Answers (1)

Yisela
Yisela

Reputation: 6941

If what you need is a footer with fixed height to always stay at the bottom, and a contents div with variable height (so you can add as many content in there as you want), then you should check this fiddle: http://jsfiddle.net/Spycho/YrRgL/2/ from this question: Variable content div height using css with fixed header and footer (first answer, in the edited area).

Something like:

body{
    padding: 0;
}

#content{
    position: absolute;
    width: 100%;
    bottom: 100px;
}

#footer{
    position: absolute;
    height: 100px;
    width: 100%;
    bottom:0;
}

Upvotes: 1

Related Questions