【发布时间】:2018-10-02 05:25:45
【问题描述】:
我正在使用最新版本的 Bootsrap
我想给 carousel-item 添加标题和文本。
但是p代码,留在同一行,
它应该在h5代码之后。
这是我的一些代码:
【问题讨论】:
标签: twitter-bootstrap bootstrap-4
我正在使用最新版本的 Bootsrap
我想给 carousel-item 添加标题和文本。
但是p代码,留在同一行,
它应该在h5代码之后。
这是我的一些代码:
【问题讨论】:
标签: twitter-bootstrap bootstrap-4
看起来是 d-flex 类引起的。 如果你改变这个:
<div class="d-flex h-100 align-items-center justify-content-center">
到这里:
<div class="custom-flex h-100 align-items-center justify-content-center">
并将其添加到您的样式表中:
.custom-flex {
display: flex;
flex-direction: column;
}
你会得到想要的结果。
编辑
要仅使用引导类,您可以添加 flex-column 类,如下所示:
<div class="d-flex flex-column h-100 align-items-center justify-content-center">
【讨论】: