【发布时间】:2019-08-20 21:02:38
【问题描述】:
如何在垂直内容之间设置空格?在示例中,在第三列中,我希望能够在不指定高度的情况下证明红色和黑色 div 之间的内容(目前在这里举个例子)。没有它我不能这样做吗,因为我们已经从中间 col 有了一个最大高度?
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" />
<div class="d-flex align-items-center">
<div class="col-auto">
<div>asdqwd</div>
</div>
<div class="col d-flex flex-column text-center">
<div>rgergre</div>
<div>vs</div>
<div>rger ergerg</div>
</div>
<div class="col-auto d-flex flex-column justify-content-between" style="height:72px">
<div style="height:20px;width:20px;background:red">ewf</div>
<div style="height:20px;width:20px;background:black">qwd</div>
</div>
</div>
【问题讨论】:
-
AFAIK,您必须为特定容器定义高度
标签: html css flexbox bootstrap-4