Quante volte vi è capitato di non riuscire a dare l’altezza al 100% dei vostri div? In questo pratico tutorial vedremo come fare utilizzando jQuery.

Dichiarate html, body {height: 100%} nel vostro CSS. Sottraete tutti i divs con una determinata altezza, come l’header, il menu e il footer. In questo modo: “#header” – “#navigation” – “#footer” + “px”. Quindi aggiungete l’elemento che avete bisogno con l’altezza a 100%.

 
$(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);
}
 

fonte: www.sastgroup.com ? Vai al post originale