Boostrap 4 Carousel
What is Carousel?
The carousel is a slideshow for cycling through a series of content, built with CSS 3D transforms and a bit of JavaScript.
It works with a series of images, text, or custom markup.
Creating a Basic Carousel:
Carousels are created using the .carousel class along with specific markup for the slides and navigation controls.
<div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="image1.jpg" alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="image2.jpg" alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="image3.jpg" alt="Third slide">
</div>
</div>
</div>
Carousel Options and Customization:
You can control slide behavior, interval timing, indicators, controls, and more.
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="image1.jpg" alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="image2.jpg" alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="image3.jpg" alt="Third slide">
</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 class="sr-only">Next</span>
</a>
</div>
Customization Options:
Set Timing: Use the data-interval attribute to control the timing between slides.
Controls: Customize the carousel navigation controls using the .carousel-control-prev and .carousel-control-next classes.