I have just successfully set up a 3-image carousel on my site using Bootstrap. This is what it looks like:
If you notice, the indicators are square and I want them to be round! All the tutorials I have followed thus far seem to get it right; I have never seen anyone else's carousel with square indicators. Here's my HTML:
<!-- Carousel start -->
<div id="myCarousel" class="carousel slide">
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img src="bootstrap/img/home-page-banner.jpg"/>
<div class="container">
<div class="carousel-caption">
<h1>Heading One</h1>
<p>Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum </p>
<p><a class="btn btn-large btn-primary">Sign up!</a></p>
</div>
</div>
</div>
<div class="item">
<img src="bootstrap/img/home-page-banner.jpg"/>
<div class="container">
<div class="carousel-caption">
<h1>Heading One</h1>
<p>Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum </p>
<p><a class="btn btn-large btn-primary">Sign up!</a></p>
</div>
</div>
</div>
<div class="item">
<img src="bootstrap/img/home-page-banner.jpg"/>
<div class="container">
<div class="carousel-caption">
<h1>Heading One</h1>
<p>Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum </p>
<p><a class="btn btn-large btn-primary">Sign up!</a></p>
</div>
</div>
</div>
</div>
<a class="left carousel-control" href="#myCarousel" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
<!-- Carousel end -->
What do you think I am going wrong with here? Is there any class I should be using with the carousel-indicators
<ol>
that I am not aware of yet?
P.s.: I have already tried .carousel-indicators { border-radius: 100%;}
with no success.
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% .
You can simply use the data-interval attribute of the carousel class. It's default value is set to data-interval="3000" i.e 3seconds. All you need to do is set it to your desired requirements.
Add border-radius
:
.carousel-indicators > li {
border-radius: 50%;
}
Note that you have to target the li
tags within the carousel-indicators
class and also do 50%
not 100%
.
So you don't have to use !important
to override the default border-radius:
#myCarousel-indicators > li {
border-radius: 50%;
}
<ol id="myCarousel-indicators" class="carousel-indicators"></ol>
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