简体   繁体   English

将页脚DIV放在页面底部

[英]Keeping a Footer DIV at the bottom of a page

I'm developing a responsive site and I'm trying to keep a DIV positioned at the bottom of the page no matter the width of the browser window that is being used. 我正在开发一个响应式网站,并且无论所使用的浏览器窗口的宽度如何,我都希望将DIV放置在页面底部。 I've tried the "Sticky Footer" method "http://ryanfait.com/sticky-footer/" but it requires you to define a height for the footer and the footer's height changes as the browser's width is resized. 我已经尝试过“ Sticky Footer”方法“ http://ryanfait.com/sticky-footer/”,但是它要求您定义页脚的高度,并且随着浏览器宽度的调整,页脚的高度会发生变化。

Are there any other methods that can be used where you don't have to define the footer's height? 在不必定义页脚高度的情况下,还有其他方法可以使用吗?

is that what you need? 那是你需要的吗?

#footer { position: fixed: bottom: 0; left: 0; }

example

change height to min-height. 将高度更改为最小高度。 Should work. 应该管用。 http://jsfiddle.net/Mrhh3/ http://jsfiddle.net/Mrhh3/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM