I think you need to try something like this.
If this is your HTML (or similar):
<div class="header">Header</div>
<div class="main">Main</div>
<div class="footer">Footer</div>
the CSS needs to look like:
html, body {
height: 100%;
}
body {
margin: 0;
}
.main {
min-height: -moz-calc(100% - 90px);
min-height: -webkit-calc(100% - 90px);
min-height: -o-calc(100% - 90px);
min-height: calc(100% - 90px);
background-color: lightgray;
}
.header, .footer {
height: 45px;
background-color: yellow;
}
You need to set a height to html
and body
or else the percentage height in .main
is not defined.