.carousel-indicators - Adds little dots/indicators at the bottom of each slide to represent current page - HTML CSS Bootstrap Class List

HTML CSS examples for Bootstrap Class List:carousel-indicators

Description

.carousel-indicators - Adds little dots/indicators at the bottom of each slide to represent current page

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head><!--from  www  .j a va2  s .  c  om-->
<body>

<div class="container">
  <h2>Carousel Example</h2>
  <div id="myCarousel" class="carousel slide" data-ride="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">

      <div class="item active">
        <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt="Los Angeles" style="width:100%;">
        <div class="carousel-caption">
          <h3>Test</h3>
          <p>This is a test!</p>
        </div>
      </div>

      <div class="item">
        <img src="http://java2s.com/resources/d.png" alt="Chicago" style="width:100%;">
        <div class="carousel-caption">
          <h3>Test</h3>
          <p>This is a test!</p>
        </div>
      </div>

      <div class="item">
        <img src="http://java2s.com/resources/e.png" alt="New York" style="width:100%;">
        <div class="carousel-caption">
          <h3>Test</h3>
          <p>This is a test!</p>
        </div>
      </div>

    </div>

    <!-- Left and right controls -->
    <a class="left carousel-control" href="#myCarousel" data-slide="prev">
      <span class="glyphicon glyphicon-chevron-left"></span>
      <span class="sr-only">Previous</span>
    </a>
    <a class="right carousel-control" href="#myCarousel" data-slide="next">
      <span class="glyphicon glyphicon-chevron-right"></span>
      <span class="sr-only">Next</span>
    </a>
  </div>
</div>

</body>
</html>

Related Tutorials