-1

I am currenly learning web development in Udemy course of Dr Angela Yu. The "Tintdog" exercise trying to apply the Carousel with controls. The slide does not slide at all even I click the next button. I also included the Bootstrap-5 and Bundle to my page. The code is as below

  <section id="testimonials">
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
  <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>
  <a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
    <span class="carousel-control-next-icon" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>
hailesuper
  • 13
  • 2

1 Answers1

0

Bootstrap 5 uses data-bs- instead of data- attributes. It should be data-bs-ride="carousel" and data-bs-slide, etc..

Carol Skelly
  • 351,302
  • 90
  • 710
  • 624