从我的研究来看,这似乎是一个绝对classic 的CSS问题,但我找不到一个明确的答案——事实就是如此.
如何将内容div设置为100%占用正文高度,减go 固定高度页眉和页脚占用的高度?
<body>
<header>title etc</header>
<div id="content">body content</div>
<footer>copyright etc</footer>
</body>
//CSS
html, body {
height: 100%;
}
header {
height: 50px;
}
footer {
height: 50px;
}
#content {
height: 100% of the body height, minus header & footer
}
我想使用纯CSS,并为答案是跨浏览器防弹.