/ Published in: jQuery

Declare html, body {height: 100%} in your css. Subtract all divs with a given height, such as a header, navigation and a footer. Like this: "#header" - "#navigation" - "#footer" + "px". Then add the element you need at 100% height.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$(document).ready(sizeContent); $(window).resize(sizeContent); function sizeContent() { var newHeight = $("html").height() - $("#subtract-all-other-divs").height() + "px"; $("#the-div-you-need-100%-height").css("height", newHeight); }
Comments
