Home > Software design >  Bootstrap 4 carousel indicators active:first issue workaround
Bootstrap 4 carousel indicators active:first issue workaround

Time:02-06

I am using bootstrap 4 and use custom arrows for left and right.

Bootstrap is not checking for li elements to add the active class and just adds class to the first element it finds.

This issue indicates incorrect state of the active slide.

e.g.

enter image description here

instead of

enter image description here

Reproduce: enter image description here

CodePudding user response:

You should move the arrows out of carouselExampleIndicators div as per the example https://getbootstrap.com/docs/4.6/components/carousel/#with-indicators

CodePudding user response:

I've resolved this issue by wrapping the carousel-indicators inside another div.

<div >
 .. icon arrow left
  <div >
     <li></li>
     <li></li>
  </div>
 .. icon arrow right
</div>
  •  Tags:  
  • Related