我和我的 friend 目前正在尝试通过各种步骤创建一个表单。
当屏幕足够小时,控件会显示在屏幕底部以指示用户可以转到下一步。
不幸的是,在 Chrome 上,这些控件有些隐藏,因为顶部栏偏移了整个 View ,如下所示:
什么是确保控件在用户访问页面时完全显示而无需实际向下滚动的最佳方法?
最佳答案
起初它似乎太简单了,但在评论中澄清后答案是使用 position:fixed;底部:0;
。关于position: fixed
的文档可以找到here :
An element with
position: fixed
is positioned relative to the viewport, which means it always stays in the same place even if the page is scrolled. The top, right, bottom, and left properties are used to position the element.
关于css - 移动版 Chrome 中的控件移至底部下方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55907782/