尝试垂直对齐文本中心在以下卡:引导4个垂直对齐文本将不会集中在卡
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<div class="row text-center h-100">
<div class="col-md-3 text-center my-auto">
<div class="card card-block justify-content-center" style="height: 120px">
<div class="card-body">
This is some text within a card body.
</div>
</div>
</div>
</div>
我充分认识到很多类似的问题在这里,然而,我尝试了各种解决方案,并没有一个似乎适用于我的卡。
我在父母,卡片和卡片身体上尝试过“my-auto”。我尝试过“d-flex align-items-center h-100”和“justify-content-center”。还试图玩弄显示属性。我错过了什么?
不错。我错过了卡体中的d-flex,之前只有在阶级卡中。 – tealowpillow
@tealowpillow高兴它的固定! –