新的“隐藏页脚”有效,但仍然与屏幕底部的内容重叠

发布于 2024-09-06 16:38:42 字数 898 浏览 8 评论 0原文

我正在设计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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

霞映澄塘 2024-09-13 16:38:42

您应该从 #wrapper 中删除负边距并设置 clear:both;位置:相对; 用于#push。希望这有帮助:D

You should remove negative margin from #wrapper and set clear:both; position: relative; for #push. Hope this helps :D

无需解释 2024-09-13 16:38:42

尝试将 position:relative 添加到页脚和包装器中。然后clear:both 到#push。看看是否有帮助。

Try adding position:relative to both your footer and wrapper. Then clear:both to #push. See if that helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文