我一直在调整我的粘性页脚,希望在它到达 #body
div 时停止它,但到目前为止,我一直没有成功。在大多数情况下,它通常不会覆盖内容,但 on this page ,它经常这样做。
如果可能的话,我想将它固定在窗口底部,但我能想到的唯一其他解决方案是固定位置。有什么建议吗?
最佳答案
好吧,您可以通过多种方式应用固定位置/粘性页脚。一种选择是仅使用 CSS,如 Twitter Bootstraps Sticky Footer example .这可能是最简单的实现。
/* The html and body elements cannot have any padding or margin. */
html,body { height: 100%; }
/* Wrapper for page content to push down footer */
#wrap {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -100px; /* Negative indent footer by it's height */
}
/* Set the fixed height of the footer here */
#push,#footer{ height:100px }
#footer {}
关于html - 如何在内容 DIV 处停止粘性页脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16259636/