【发布时间】:2020-04-13 22:20:35
【问题描述】:
当我设置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>
【问题讨论】:
标签: html css twitter-bootstrap bootstrap-4 flexbox