Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Carousel indicators not showing up on white background on slides (custom style or class add)?

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?

like image 898
genxgeek Avatar asked Jul 26 '13 04:07

genxgeek


People also ask

How do I customize Bootstrap carousel-indicators?

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% .

How do you use carousel-indicators?

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.

What is class carousel slide?

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.


1 Answers

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).


Bootstrap 2.3.2

.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




Bootstrap 3.4.1 & 4.3.1

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


like image 183
thiagobraga Avatar answered Oct 03 '22 15:10

thiagobraga