新的“隐藏页脚”有效,但仍然与屏幕底部的内容重叠
我正在设计http://www.vanessacaroline.com并且需要一些CSS 帮助。如果您当前的屏幕分辨率没有使问题变得明显,请尝试重新调整窗口大小,以便示例 2 列布局推动页脚 - 最简单的演示方法是抓住浏览器窗口的底部边缘,然后向上拖动。
太恶心了吧?内容不仅没有按应有的方式将页脚向下推,而且页面甚至没有创建滚动条。
如果水平缩放窗口,第二个浮动列 div 会下降并淹没页脚。
但是,如果水平缩小窗口,最终列内容开始将页脚向下推......这是正确的功能,但我似乎无法摆脱最初的洪水。
我一直在尝试制作一个相对流体布局;我使用此参考: http://ryanfait.com/sticky-footer/ 作为页脚代码。我在网上看到了一些其他方法,但我选择了这个 - 我想要正常的内容/滚动条行为,页脚始终粘在页面底部;有人可以帮忙吗?
谢谢!
编辑:我用第一个建议更新了网站——clear:both都在#push中,以及#wrapper、#push和#footer的position:relative。现在页脚出现在加载屏幕位置的阈值以下......这创建了一个很好的“隐藏页脚效果”。
我喜欢这个——但在极薄的屏幕分辨率下演示,页脚与底部的内容重叠。 我该如何避免这种情况???
I'm in the middle of designing http://www.vanessacaroline.com and in need of a bit of CSS assistance. If your current screen resolution doesn't make the problem obvious, try re-sizing the window so that the sample 2-column layout would push the footer--most simply demonstrated by grabbing your browser window's bottom edge, and dragging up.
Gross right? Not only does the content not push the footer down the way it should, but the page doesn't even create a scroll bar.
If you scale the window horizontally, the 2nd floated column div drops down and floods the footer.
However, if you shrink the window horizontally, eventually the column content begins to push the footer down... which is the correct functionality, but I can't seem to get rid of that initial flooding.
I've been trying to make a relatively fluid layout; I used this reference: http://ryanfait.com/sticky-footer/ for the footer code. I've seen a few other ways on the net, but I went with this one -- I want normal content/scroll-bar behavior, with a footer always stuck to the bottom of the page; can anyone help?
Thanks!
Edit: I updated the site with the first suggestion--clear:both in the #push, and a position:relative for #wrapper, #push and #footer. Now the footer appears below the threshold of the loaded screen position...which creates a nice "hidden footer effect."
I like this -- but demonstrated at extremely thin screen-resolutions, the footer overlaps the content at the bottom. How do I avoid this???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该从 #wrapper 中删除负边距并设置
clear:both;位置:相对;
用于#push。希望这有帮助:DYou should remove negative margin from #wrapper and set
clear:both; position: relative;
for #push. Hope this helps :D尝试将
position:relative
添加到页脚和包装器中。然后clear:both
到#push。看看是否有帮助。Try adding
position:relative
to both your footer and wrapper. Thenclear:both
to #push. See if that helps.