How to Add a Responsive Carousel with Captions in Bootstrap ? Last Updated : 21 Mar, 2024 Comments Improve Suggest changes Like Article Like Report Carousels are interactive components in web design, often used to display multiple images or content sequentially. They're useful for showcasing images one after another, with captions providing additional context or information. We will see how to create a responsive carousel with captions in Bootstrap. ApproachFirst, create a basic HTML structure for the carousel and add the Bootstrap 5 CDN links.Then use the "container" class which contains the carousel and then use the "carousel" class to define the carousel.Within the carousel, use the "carousel-inner" to hold the carousel items. Each carousel item should include an image (<img>) and a caption (<div class="carousel-caption">).And use those utility classes like "carousel-caption", "img-fluid", "bg-dark", "bg-gradient", and "text-light" for caption, to make the responsive image, background colors, and text color.Use flexbox utilities like "d-flex" and "justify-content-center" to center the carousel horizontally.Example: Implementation of adding a responsive carousel with captions in Bootstrap. HTML <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Responsive Carousel</title> <link rel="stylesheet" href= "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"> </head> <body class="bg-success d-flex flex-column min-vh-100"> <div class="container py-5"> <div class="row"> <div class="col-12 text-center"> <h1 class="text-light"> Geeksforgeeks Responsive Carousel in Bootstrap 5 </h1> </div> </div> </div> <div class="container flex-grow-1"> <div class="row"> <div class="col-md-8 offset-md-2 d-flex justify-content-center"> <div id="carouselExampleIndicators" class="carousel slide" data-bs-ride="carousel" style="max-width: 600px;"> <div class="carousel-inner"> <div class="carousel-item active"> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20240308154939/html-(1).jpg" class="d-block w-100 img-fluid" alt="Slide 1"> <div class="carousel-caption bg-dark bg-gradient p-3 rounded"> <h5 class="text-light">HTML Basics</h5> <p class="text-light"> Master the fundamentals of HTML programming. </p> </div> </div> <div class="carousel-item"> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20240308154940/js-(1).jpg" class="d-block w-100 img-fluid" alt="Slide 2"> <div class="carousel-caption bg-dark bg-gradient p-3 rounded"> <h5 class="text-light"> JavaScript Essentials </h5> <p class="text-light"> Explore essential concepts of JavaScript programming. </p> </div> </div> <div class="carousel-item"> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20240308154942/web-(1).jpg" class="d-block w-100 img-fluid" alt="Slide 3"> <div class="carousel-caption bg-dark bg-gradient p-3 rounded"> <h5 class="text-light"> Web Development Basics </h5> <p class="text-light"> Learn the core concepts of web development. </p> </div> </div> <div class="carousel-item"> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20240308154945/web2-(1).jpg" class="d-block w-100 img-fluid" alt="Slide 4"> <div class="carousel-caption bg-dark bg-gradient p-3 rounded "> <h5 class="text-light"> Advanced Web Topics </h5> <p class="text-light"> Dive into advanced topics in web development. </p> </div> </div> </div> <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleIndicators" 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="#carouselExampleIndicators" data-bs-slide="next"> <span class="carousel-control-next-icon" aria-hidden="true"></span> <span class="visually-hidden">Next</span> </button> </div> </div> </div> </div> <script src= "https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"> </script> </body> </html> Output: Output Comment More infoAdvertise with us Next Article Design a Responsive Card with a Carousel inside it in Bootstrap S skaftafh Follow Improve Article Tags : Web Technologies Bootstrap Bootstrap-Questions Similar Reads How to make Responsive Carousel in Bootstrap ? Bootstrap Responsive Carousel simplifies the creation of responsive carousels for dynamic content display. Utilize the Carousel component with a suitable HTML structure, ensuring proper sizing and responsive breakpoints for optimal display across devices. ApproachCreate an HTML document with Bootstr 2 min read How to Create Responsive Card with a Video Background in Bootstrap? Cards are very useful things in web development. Cards can hold various types of content, such as text, images, and links, making them perfect for displaying information in a structured format. And the background video can enhance the style of the web page. In this tutorial, we will focus on how to 2 min read Design a Responsive Card with a Carousel inside it in Bootstrap A responsive carousel displays images or content in a rotating manner, adjusting seamlessly to different screen sizes for optimal viewing experience. In this article, we will create a responsive card with a carousel inside it with the help of Bootstrap5.Preview:ApproachHere we create a Bootstrap car 2 min read Bootstrap 5 Carousel With Captions Bootstrap 5 Carousel With captions means we can add a class carousel-caption to the carousel items to add a caption for them.Bootstrap 5 Carousel With Captions Class:carousel-caption: This class is used for giving carousel captions.Syntax<div class="carousel-caption"> ...</div>Example 1: 2 min read How to Create Responsive Divs in Bootstrap ? To create responsive divs in Bootstrap, utilize the grid system with container and row classes. Define columns using col classes and specify breakpoints for different screen sizes. This ensures divs adjust their layout and size responsively across devices. Below are the approaches to creating respon 2 min read How to Create a Responsive Image Gallery in Bootstrap ? An image gallery is like a digital album where we can put our multiple images to attract user attention. We have used Bootstrap a CSS framework for Creating a Responsive Image Gallery where the layout adjusts automatically based on the screen size, ensuring that it looks good on both large desktop s 3 min read Like