【发布时间】:2021-12-31 19:07:35
【问题描述】:
我正在尝试实现一个教程类项目,该项目使用 bootstrap5 轮播上一个和下一个滑动按钮。如果我执行此操作,我会在按钮上出现框并且按钮不起作用。 enter image description here
<section id="testimonials">
<div id="testimonial-carousel" class="carousel slide" data-bs-ride="carousel" data-bs-interval="1000">
<div class="carousel-inner">
<div class="carousel-item active">
<h2>I no longer have to sniff other dogs for love. I've found the hottest Corgi on TinDog. Woof.</h2>
<img class="testimonial-image" src="images/dog-img.jpg" alt="dog-profile">
<em>Pebbles, New York</em>
</div>
<div class="carousel-item">
<h2 class="testimonial-text">My dog used to be so lonely, but with TinDog's help, they've found the love of their life. I think.</h2>
<img class="testimonial-image" src="images/lady-img.jpg" alt="lady-profile">
<em>Beverly, Illinois</em>
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#testimonial-carousel" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden"></span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#testimonial-carousel" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden"></span>
</button>
</div>
</section>
【问题讨论】:
-
我使用您的代码 (jsfiddle.net/deathstalkersid/3zcs7uxa/1) 做了一个小提琴,除了标题和图像格式,控件上方没有框。也许您的自定义样式中的其他内容会覆盖按钮 css。如果您修改了整个代码,我们可以调试。
标签: html bootstrap-5