【发布时间】:2018-09-14 08:45:46
【问题描述】:
我在这里查看了许多问题以及许多文章和 bootstrap 4 文档,但未能找到我要查找的内容。
演示:https://jsfiddle.net/zxLLqsm0/
我希望为所有列创建具有完全相同高度的框,并将框内的文本垂直居中对齐。我设法使文本垂直对齐,但框的高度不同。
这是我的 HTML
<div class="container">
<div class="row align-items-center">
<div class="col-4">
<div class="box">
<h6>Title 1</h6>
<p>A small description</p>
</div>
</div>
<div class="col-4">
<div class="box">
<h6>Title 2</h6>
<p>A bigger description goes here</p>
</div>
</div>
<div class="col-4">
<div class="box">
<h6>Title 3</h6>
<p>A large description is placed here to make whatever changes we need.</p>
</div>
</div>
</div>
</div>
还有我的 CSS:
.container {
margin-top: 15px;
}
.box {
background-color: grey;
padding: 15px;
}
【问题讨论】:
标签: html css twitter-bootstrap flexbox bootstrap-4