【发布时间】:2022-07-16 03:31:01
【问题描述】:
当我添加类 float-end 时,它会将按钮向右推,但旁边的 div 标签位于它的前面。
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<div class="col-md-7 bg-white shadow-sm rounded-3 mx-3 ">
<div>
<a href="#" class="btn btn-sm btn-primary m-2 mr-0">
Edit <i class="bi bi-pencil"></i>
</a>
</div>
<div class="d-flex p-2 justify-content-between border-bottom">
<div class="fw-bold">Pan no</div>
<div class="text-secondary">not added</div>
</div>
<div class="d-flex p-2 justify-content-between border-bottom">
<div class="fw-bold">Birthdate</div>
<div class="text-secondary">not added</div>
</div>
</div>
【问题讨论】:
-
在现代布局中通常要避免浮动。 Bootstrap 提供了实现相同结果所需的所有 flex 实用程序。
-
请接受您的回答来解决这个帖子。
标签: css twitter-bootstrap bootstrap-5