我需要使我的网页高度适合屏幕大小的高度而不滚动。
HTML
<body>
<form id="form1" runat="server">
<div id="main">
<div id="content">
</div>
<div id="footer">
</div>
</div>
</form>
</body>
CSS
#content{ background-color:#F3F3F3; margin:auto;width:70%;height:700px;}
#footer{width:100%;background-color:#666666;height:200px;}
原文由 Joshua 发布,翻译遵循 CC BY-SA 4.0 许可协议
一个快速、不优雅但独立工作的解决方案,带有内联 CSS,没有 jQuery 要求。 AFAIK 它也适用于 IE9。