Carousel Bootstrap

Asked

Viewed 1,528 times

2

Hello, I wanted to know how to exchange these indicators, instead of buttons for texts, follow the code below:

 <div id="myCarousel" class="carousel slide" data-interval="3000" data-ride="carousel">
    <!-- Carousel indicators -->
    <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>   

CSS

.carousel-indicators {
  position: absolute;
  bottom: 10px;
  left: 50%;
  z-index: 15;
  width: 60%;
  margin-left: -30%;
  padding-left: 0;
  list-style: none;
  text-align: center;
}
.carousel-indicators li {
  display: inline-block;
  width: 100px;
  height: 100px;
  margin: 1px;
  
  border: 1px solid #fff;
  border-radius: 10px;
  cursor: pointer;
  background-color: red;
  background-color: blue;
}
.carousel-indicators .active {
  margin: 0;
  width: 120px;
  height: 120px;
  background-color: red;
}

  • Have you tried to remove the attributes that draw the button and put text inside the li?

  • removed, and added, all right, vlw.

1 answer

2


Here is an example of the implementation of Bootstrap Carousel with text in place of the next and previous buttons:

<div id="myCarousel" class="carousel slide" data-interval="3000" data-ride="carousel">
<!-- Carousel indicators -->
<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>

<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
    <div class="item active">
        <img src="..." />
        <div class="carousel-caption">...</div>
    </div>
    <div class="item">
        <img src=..." />
        <div class="carousel-caption">...</div>
    </div>
        ...
</div>

<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
    <span>Anterior</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
    <span>Próximo</span>
</a>
</div>
  • In my case it was in the slide indicators, but I already solved, thank you very much.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.