本文介绍了修正了页眉,页脚与可滚动内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获得固定页眉,可滚动内容的页脚?像这样的

解决方案

类似于这样的

 < HTML> 
< body style =height:100%; width:100%>
< div id =headerstyle =position:absolute; top:0px; left:0px; height:200px; right:0px; overflow:hidden;>
< / div>
< div id =contentstyle =position:absolute; top:200px; bottom:200px; left:0px; right:0px; overflow:auto;>
< / div>
< div id =footerstyle =position:absolute; bottom:0px; height:200px; left:0px; right:0px; overflow:hidden;>
< / div>
< / body>
< / html>


How can I get fixed header, footer with scrollable content? Something like this page. I can look at the source to get the CSS, but I just want to know minimum CSS and HTML I need to get this working.

解决方案

Something like this

<html>
  <body style="height:100%; width:100%">
    <div id="header" style="position:absolute; top:0px; left:0px; height:200px; right:0px;overflow:hidden;">
    </div>
    <div id="content" style="position:absolute; top:200px; bottom:200px; left:0px; right:0px; overflow:auto;">
    </div>
    <div id="footer" style="position:absolute; bottom:0px; height:200px; left:0px; right:0px; overflow:hidden;">
    </div>
  </body>
</html>

这篇关于修正了页眉,页脚与可滚动内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 08:10