我需要将主div高度拉伸到视口高度并将页脚放置在屏幕底部。有人可以解决这个问题吗?如何将高度设置为主div?
body{text-align:center;}
#main{width:200px;margin:0px auto;background:#cccccc;}
#header{height:20px;background:#00FFFF;}
#content{height:80px;background:#cccccc;}
#footer{background:#0000FF;height:20px;}
.demo{width:90%;margin:0px auto;}
<div id="main">MAIN
<div id="header" class="demo">HEADER</div>
<div id="content" class="demo">CONTENT</div>
<div id="footer" class="demo">FOOTER</div>
</div>
看一看[这个问题](http://stackoverflow.com/questions/42294/how-do-you-get-the-footer-到待在最底的-A-网页)。 – 2009-04-09 12:36:51
简直不敢相信这一点是多么简单 – wheresrhys 2009-04-09 16:03:32