设置 div自适应高度

<body>  

 <div class = "row">

 <div id = "top" >上部 </div>

 <div id = "main">中间部分 </div>

 <div id = "bottom" >底部</div>

</div>  


<script>

jQuery('#right').css('min-height',(jQuery('body').height()-175)+"px");

</script>  

</body>


175为top和bottom2部分高的和。也可通过jquery动态获取jQuery('#top').height()+jQuery('#bottom').height()


设置min-height最小高度,这样中间部分高度可以自动扩大