为什么当我设置 height: 100% 或 h-100 时,绿色容器会扩展到蓝色列上?
我怎样才能使它适合柱子的剩余高度?
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/css/bootstrap.min.css">
<div class="container" style="background-color: black">
<div class="row">
<div class="col-sm-6" style="background-color: red">
<p>Some</p>
<p>More</p>
<p>Content</p>
<p>Here</p>
</div>
<div class="col-sm-6" style="background-color: blue">
<h3>Content I want to keep</h2>
<section class="d-flex h-100" style="background-color: green">
<button class="btn btn-danger m-auto">Centered Button</button>
</section>
</div>
</div>
</div>
慕后森
相关分类