我试图给我的网站设置一个适合屏幕的应用程序,但是我遇到了一些问题,我知道CSS在基本方面的来龙去脉,但是我有点困惑使用百分比。我需要一个标题(50像素),然后我需要一个盒子(高度100%),然后是一个小盒子页脚(20像素),但是这一切都需要在屏幕上没有溢出,当我尝试与给定的代码我得到一个溢出,因为100%的项目将页脚压下导致溢出滚动条。CSS高度百分比规范
<div id="holder"> <-- this is set to 100% width & height as well as html, body
<div id="header">
</div>
<div id="inner_holder"> <-- This is the holder which is 100%
</div>
<div id="footer">
<div/>
</div>
听起来像你需要Google css +粘性页脚? – FiveTools