如何在 HTML 中制作底部固定位置菜单?
我想在浏览器窗口的最底部创建一个框菜单。
- 当内容没有填满整个屏幕时,它应该停留在底部
- 当内容溢出时,它应该只在您向下滚动时位于底部(即,如果不滚动,您就看不到它)。
我该怎么做?
I want to create a box-menu on the very bottom of the browser window.
- It should stay at the bottom when the content doesn't fill up the entire screen
- When the content overflows it should only be at the bottom when you scroll down (i.e. you can't see it if you don't scroll).
How do I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您正在寻找的称为“粘性页脚”,有几种方法。我建议您查看这些网站:
放大/缩小每个站点,以便查看内容到达页脚或未到达页脚时的显示效果。
这两种方法都缺少一件事:它们要求您知道页脚的高度 - 但我还没有看到任何仅使用 CSS 的更好的解决方案。
I think what you are looking for is called a "sticky footer", and there are a couple of methods. I suggest you have a look at these sites:
Zoom in/out on each site in order to see how this appears when the content reaches the footer or does not.
Both methods fall short on one thing: They require you to know the height of the footer - but I have not seen any better solutions with only CSS.