Html 引导程序4:将内容固定在容器底部
我有一个围绕着Html 引导程序4:将内容固定在容器底部,html,css,bootstrap-4,Html,Css,Bootstrap 4,我有一个围绕着的应用程序,其中有一个编辑器和几个按钮,我总是想在底部显示这些按钮,比如: 用另一个容器包装您的“提交表单”,或使用col-*定位 例如: <div class="container> // some content.... // this should be shown always at the bottom! <div id="bottom" class="container fixed-bottom submit-form">
的应用程序,其中有一个编辑器和几个按钮,我总是想在底部显示这些按钮,比如:
用另一个容器包装您的“提交表单”,或使用col-*
定位
例如:
<div class="container>
// some content....
// this should be shown always at the bottom!
<div id="bottom" class="container fixed-bottom submit-form">
<div id="editor"></div>
<div class="btn btn-grp" ></div>
</div>
</div>
之后,此表单将与屏幕左侧对齐
使用d-flex定位引导列:
<div class="container>
// some content....
// this should be shown always at the bottom!
<div class="d-flex justify-content-center fixed-bottom">
<div id="bottom" class="col-4 submit-form">
<div id="editor"></div>
<div class="btn btn-grp" ></div>
</div>
</div>
</div>
如果您使用的是BS4,那么BS提供了很多类,请使用这些类来实现您的输出
我在行中添加了一些高度,只是为了向您展示所需的结果,因为我们将在容器中包含一些内容,这样您就不需要在行中添加任何高度
注意:如果您不想使用row,以防万一,那么在容器上使用classd-flex
,其余部分将保持不变
按钮
请提供最小可再现问题。添加CSS代码,这样我们就可以测试它了。你能添加完整的基本代码吗?容器底部还是屏幕底部,不管容器的高度如何?这对我帮助很大。结果不是我所需要的,而是把我推向了正确的方向。我很高兴我能帮上忙。如果您有其他解决方案,请与我们分享。
<div class="container>
// some content....
// this should be shown always at the bottom!
<div class="d-flex justify-content-center fixed-bottom">
<div id="bottom" class="col-4 submit-form">
<div id="editor"></div>
<div class="btn btn-grp" ></div>
</div>
</div>
</div>