【发布时间】:2021-12-07 05:46:54
【问题描述】:
我想要它,如下图所示,但我无法设置。我正在分享我在下面编写的代码。我该如何解决这个问题?
我的代码:
#mybtn{
position: fixed;
bottom: 10px;
right: 10px;
}
<div class="row">
<div class="col-lg-8" style="position: relative;">
<p>this is my content</p>
<button id="mybtn">My Fixed Button</button>
</div>
<div class="col-lg-4">
<p>content area</p>
</div>
</div>
【问题讨论】:
-
我认为您可以将
d-flex ml-auto引导类应用于按钮以实现您想做的事情。 -
将
position: absolute与相对父级一起使用。 -
使用位置:绝对代替位置:固定
标签: html css bootstrap-4 fixed