BS5 Carousel
Bootstrap 5 Carousel
A slideshow that cycles over elements is called a carousel.
==== IMAGE MUKAVI ====
How To Create a Carousel
An illustration of how to make a simple carousel with controls and indicators can be found below:
Example
Example explained
An explanation of the functions of each class in the previous example:
Class | Description |
---|---|
.carousel | Creates a carousel |
.carousel-indicators | Adds indicators for the carousel. These are the little dots at the bottom of each slide (which indicates how many slides there are in the carousel, and which slide the user are currently viewing) |
.carousel-inner | Adds slides to the carousel |
.carousel-item | Specifies the content of each slide |
.carousel-control-prev | Adds a left (previous) button to the carousel, which allows the user to go back between the slides |
.carousel-control-next | Adds a right (next) button to the carousel, which allows the user to go forward between the slides |
.carousel-control-prev-icon | Used together with .carousel-control-prev to create a “previous” button |
.carousel-control-next-icon | Used together with .carousel-control-next to create a “next” button |
.slide | Adds a CSS transition and animation effect when sliding from one item to the next. Remove this class if you do not want this effect |
Add Captions to Slides
==== IMAGE MUKAVI ====
To make a caption for each slide, add components inside <div class=”carousel-caption”> within each <div class=”carousel-item”>:
Example