Not all answers have considered your request that the solution will respond (with which I assume you mean scalability). If this is normal for the footer height, the solution is easy:
.main { height: 500px; position: relative; } .content { height: 90%; } .footer { bottom: 0; height: 10%; position: absolute; width: 100%; }
If the footer needs to be fixed in height, the solution is still pretty simple, but no longer has excellent browser support:
.main { height: 500px; position: relative; } .content { height: calc(100% - 50px); } .footer { bottom: 0; height: 50px; position: absolute; width: 100%; }
Notes: Content-Box (the default element determination method) ADDS does things like fields to the sizes you specify. If you specify the dimensions in pixels, this is just a minor annoyance - you simply subtract the borders / fields / etc from your declared sizes. If you use interest to respond quickly ... it's out of the mess. You need to apply the Border-Box, in which SUBTRACTS will be displayed as fields with the dimensions you specified.
* { box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; }
source share