Bootstrap Carousel

Please follow the following steps to use bootstrap carousel.

Bootstrap Carousel

Code Structure
<div class="container">
    <div id="myCarousel" class="carousel slide" data-ride="carousel">
        <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" role="listbox">
            <div class="item active">
                <img src="http://www.codetuts.info/wp-content/uploads/2016/01/bike1.jpg" alt="Chania">
            </div>
            <div class="item">
                <img src="http://www.codetuts.info/wp-content/uploads/2016/01/bike2.jpg" alt="Chania">
            </div>
            <div class="item">
                <img src="http://www.codetuts.info/wp-content/uploads/2016/01/bike3.png" alt="Flower">
            </div>
        </div>
        <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
            <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
            <span class="sr-only">Previous</span>
        </a>
        <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
            <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
            <span class="sr-only">Next</span>
        </a>
    </div>
</div>

Bootstrap Carousel with Caption

Code Structure
<div class="container">
    <div id="myCarousel" class="carousel slide" data-ride="carousel">
        <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" role="listbox">
            <div class="item active">
                <img src="http://www.codetuts.info/wp-content/uploads/2016/01/bike1.jpg" alt="Chania">
                <div class="carousel-caption">
                    <h3>Bike</h3>
                    <p>The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested.</p>
                </div>
            </div>
            <div class="item">
                <img src="http://www.codetuts.info/wp-content/uploads/2016/01/bike2.jpg" alt="Chania">
                <div class="carousel-caption">
                    <h3>Bike</h3>
                    <p>The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested.</p>
                </div>
            </div>
            <div class="item">
                <img src="http://www.codetuts.info/wp-content/uploads/2016/01/bike3.png" alt="Flower">
                <div class="carousel-caption">
                    <h3>Bike</h3>
                    <p>The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested.</p>
                </div>
            </div>
        </div>
        <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
            <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
            <span class="sr-only">Previous</span>
        </a>
        <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
            <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
            <span class="sr-only">Next</span>
        </a>
    </div>
</div>

Share this

Related Posts