Why is the Carousel Slide in my code not working?

Viewed 47

I am try to use the following Bootstrap code however it is only showing the first slide and not moving to the next one. Not sure whats going on :(

<section id="testimonials">

    <div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel">
      <div class="carousel-inner">
        <div class="carousel-item active">
          <h2 class="testimonial">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>
</div>
</section>
1 Answers

If you are on Bootstrap 5 then the answer will be that you're using Bootstrap 3 syntax on one of the attributes.

data-ride="carousel"

Should be

data-bs-ride="carousel"
Related