Html 如何在页面底部创建停靠式工具栏?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1055539/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 00:02:26 来源:igfitidea点击:
How to create dock type toolbar at the bottom of the page?
提问by coderex
回答by Matt Bridges
<div id="toolbar" style="position: fixed; bottom: 0px; left: 0px; width: 100%; color: #fff; background: #000;">
Toolbar Content
<!-- rest of your toolbar stuff here -->
</div>
That will create a div with a black background that remains at the bottom of the screen, regardless of browser resizing or scrolling. You can then style that div however you like.
这将创建一个黑色背景的 div,该 div 保留在屏幕底部,无论浏览器调整大小或滚动。然后,您可以随意设置该 div 的样式。
回答by Stefano Borini
you use the css directive for positioning
您使用 css 指令进行定位
position: fixed;