如何将页脚推到页面的底部,但避免使用滚动条? [英] How do I push the footer to the bottom of the page but avoid a scrollbar?

查看:98
本文介绍了如何将页脚推到页面的底部,但避免使用滚动条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我工作的网站:



http://uber.imu.uiowa.edu/isa/



页脚浮动到页面的顶部,因为没有没有足够的内容,所以我使用这个技巧将页脚推到底部:

http://ryanfait.com/resources/footer-stick-to-bottom-of-page/



问题是,空间太多,它添加了一个滚动条。我该如何解决它,所以页脚是在页面的底部,但不添加滚动条?

目前的方法很好,我一直都在使用它。您只是忘记将包装的负底边距设置为与页脚和页脚推送相同的高度。将你的 .wrapper css更新为这个 margin:0 auto -300px; 在chrome检查器中,

This is the website I'm working on:

http://uber.imu.uiowa.edu/isa/

The footer was floating to the top of the page since there wasn't enough content, so I used this trick to push the footer to the bottom:

http://ryanfait.com/resources/footer-stick-to-bottom-of-page/

Problem is, there is too much space and it added a scrollbar. How do I fix it so the footer is on the bottom of the page, but doesn't add that scrollbar?

解决方案

The current method is great, i use it all the time. You just forgot to set the negative bottom margin of the wrapper to the same height as footer and footer-push. Update your .wrapper css to this margin: 0 auto -300px; Did the trick for me in the chrome inspector.

这篇关于如何将页脚推到页面的底部,但避免使用滚动条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆