我试图将我的页脚推到页面的底部,而不管页面上的内容有多少或多少。我的大部分网页都将它推到最底部没什么问题,但内容较少的网页在页面中间有一个浮动页脚。即使我有将内容高度设置为身高的100%
html,body{height:100%}
时
#content{height:100%}
设置内容部分不会获得高度。我搞砸了
clear:both
overflow:hidden
#content:after{}
无济于事。
<html>
<body>
<header>
<h1>Header Name</h1>
</header>
<section id="content">
<p>Temp Text</p>
</section>
<section id="footer">
<footer>
<p>All rights reserved</p>
</footer>
</section>
</body>
</html>
编辑:使用视口高度(VH)单元具有让我延伸内容部分的高度,而是由上述头实现。因此,如果我的视口900px,200px标题,我的页脚被推到视口下方200px。
你可以找到答案在这些问题中的任何一个,其中大部分都是重复的[footer stick](http://stackoverflow.com/search?q=footer+stick)...就像你的。 – Jayx
[你如何让页脚停留在网页底部?](http://stackoverflow.com/questions/42294/how-do-you-get-the-footer-to-stay在网页的底部) – Jayx
@Jayx我已经尝试过每个类似的帖子在本网站和它的外部(包括你链接的),并没有找到合适的解决方案。 – Chris