Carousel A slideshow component for cycling through elements—images or slides of text—like a 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. It also includes support for previous/next controls and indicators.
Kitchen sink example
The
.activeclass needs to be added to one of the slidesotherwise the carousel will not be visible. Also be sure to set a unique id on the .carouselfor optional controls, especially if you’re using multiple carousels on a single page. Control and indicator elements must have a data-targetattribute (or hreffor links) that matches the id of the .carouselelement.
Slides only
.d-blockand .w-100on carousel images
Control example
Interval example
data-interval=""to a .carousel-itemto change the amount of time to delay between automatically cycling to the next item. E.g The first image will change after 10 seconds, the second one will change after 2 seconds, and the following will change as default settings.
Indicators example
Crossfade example
.carousel-fadeto your carousel to animate slides with a fade transition instead of a slide
Add captions
.carousel-captionelement within any .carousel-item. They can be easily hidden on smaller viewports, as shown below, with optional display utilities. We hide them initially with .d-noneand bring them back on medium-sized devices with .d-md-block
