How can I restyle my carousel indicators? I have white slides with middle content and the white indicators are not showing up. How can I customize to use a darker color so they show up?
You just need to override two properties ( width and height ) and add a new one, border-radius , to . carousel-indicators li . Make width and height values equal eg: 10px each and give a border-radius of 100% .
The indicators 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 is currently viewing). The indicators are specified in an ordered list with class . carousel-indicators . The data-target attribute points to the id of the 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.
Overwrite the class .carousel-indicators li
in another file, after the Bootstrap CSS bundle. Below I show some snippets for each version of Bootstrap up to the current version (v4).
.carousel-indicators li {
background-color: #999;
background-color: rgba(70, 70, 70, 0.25);
}
.carousel-indicators .active {
background-color: #444;
}
CodePen for Bootstrap v2.3.2
The same rule applies to both versions.
/* Add an extra .carousel parent class to increase specificity
avoiding the use of !important flag. */
.carousel .carousel-indicators li {
background-color: #fff;
background-color: rgba(70, 70, 70, 0.25);
}
.carousel .carousel-indicators .active {
background-color: #444;
}
CodePen for Bootstrap v3.4.1
CodePen for Bootstrap v4.3.1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With