我正在制作一个具有 960px 宽 div 的 CSS 布局,我想让它从页面顶部到达底部。显而易见的解决方案是min-height: 100%;
,但它不起作用。这是我的CSS:
* {
margin: 0px;
padding: 0px;
}
body {
background: #FF0000;
height: 100%;
}
html {
height: 100%;
}
#sheet {
width: 960px;
min-height: 100%;
background: #000000;
margin: 0px auto 0px auto;
}
#sheet1 {
width: 760px;
min-height: 100%;
top: 0px;
bottom: 0px;
background: #FFFFFF;
}
从我的 HTML 中:
<div id="sheet">
<div id="sheet1">
</div>
</div>
当我将 #sheet's 更改为 时,它显示正常min-height
,height
但如果内容占用超过一页,它就会被切断。有解决方案吗?