A carousel is a user interface component that allows users to cycle through a set of items, such as images or text, usually in a rotating manner. Carousels are often used on websites to showcase content while saving screen space. They can be particularly useful for displaying multiple items in a visually appealing way, without taking up too much space on the page.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Carousel Examples</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<h2>Image Carousel Example</h2>
<div id="carouselExample" class="carousel slide" data-bs-ride="carousel" data-bs-interval="2000">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="Bird.jpg.jpg" class="d-block w-100" alt="First Slide">
<div class="carousel-caption d-none d-md-block">
<h5>First Slide Label</h5>
<p>This is the description for the first slide.</p>
</div>
</div>
<div class="carousel-item">
<img src="sky.jpg" class="d-block w-100" alt="Second Slide">
<div class="carousel-caption d-none d-md-block">
<h5>Second Slide Label</h5>
<p>This is the description for the second slide.</p>
</div>
</div>
<div class="carousel-item">
<img src="Rose.jpg.jpg" class="d-block w-100" alt="Third Slide">
<div class="carousel-caption d-none d-md-block">
<h5>Third Slide Label</h5>
<p>This is the description for the third slide.</p>
</div>
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExample" data-bs-slide="prev" onclick="$('#textCarousel').carousel('prev');">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExample" data-bs-slide="next" onclick="$('#textCarousel').carousel('next');">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
<h2>Text Carousel Example</h2>
<div id="textCarousel" class="carousel slide my-4" data-bs-ride="carousel" data-bs-interval="2000">
<div class="carousel-inner">
<div class="carousel-item active">
<div class="d-flex justify-content-center align-items-center" style="height: 200px; background-color: #000000;">
<h5 class="text-light">This is the first text slide.</h5>
</div>
</div>
<div class="carousel-item">
<div class="d-flex justify-content-center align-items-center" style="height: 200px; background-color: #000000;">
<h5 class="text-light">This is the second text slide.</h5>
</div>
</div>
<div class="carousel-item">
<div class="d-flex justify-content-center align-items-center" style="height: 200px; background-color: #000000;">
<h5 class="text-light">This is the third text slide.</h5>
</div>
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#textCarousel" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#textCarousel" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>