在 bootstrap 5.3 中将轮播标题对齐到顶部

问题描述 投票:0回答:0

我正在尝试将我所有的内联样式放入 css - 或者最好只使用引导程序类来进行样式设置。如果我添加内联样式,我可以垂直对齐我的旋转木马标题,但似乎无法成功将其添加到我的 css。我知道我正在使用显示实用程序,并且认为这就是为什么尽管在这个问题上有几次阅读机会,但我还是遇到了问题。

我的旋转木马字幕代码如下所示:

                <div class="carousel-item" data-bs-interval="2000">
                <img src="image.jpg" class="d-block w-100 border border-3 border-dark shadow-lg rounded" alt="">
                <div class="carousel-caption d-none d-md-block border border-info border-2 rounded text-light bg-dark" style="top: 45px; bottom: auto;">
                    <h5 class="text-primary">My caption here<br> More on my caption</h5>
                    <p>My text here<br>More text</p>
                </div>

上面的代码有效,但我想将这些样式移出行外,或者使用引导程序的类来完成我在这里所做的样式。

当我将它们放入我的样式表时,我在这里找到的所有选项都不起作用。

发送帮助!谢谢!

css sass bootstrap-5 display bootstrap-carousel
© www.soinside.com 2019 - 2024. All rights reserved.