Image Carousel with Bootstrap




Carousel is an idea of assembling more than one content together by displaying them in one division and changing each content according to some delay in some seconds. The can be userd to display multiple images or texts in a webpage. By using a carousel,you can reduce the bulkyness and space of the contents reside inside your webpage and the give a stylish look to your website.

Here I created a simple carousel with the help of bootstrap along with the next and preview image icon and its status bar on the bottom. Here the status bar is in a rectangular look. You can change the look of the status bar from rectangle to circle by adding border-radius to the status icon.

Here is the live implementation of the image Carousel that you can apply to your website.


Live Preview:





This is the common design of the image Carousel that is used by most of the websites to display their images. You can add any number of images by placing more img tags inside the code.The next image or previous image can be seen by click on the arrow marks placed on both side of the carousel. You can also change the image by sliding the image to left or right positions. This simplicity of the bootstrap made the bootstrap famous.

The source code of the image carousel is given below:

Code:

<html>
<head>


<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
  <ol class="carousel-indicators">
    <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
    <li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
    <li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
  </ol>
  <div class="carousel-inner">
    <div class="carousel-item active">
      <img class="d-block w-100" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzIdXKdmcWRSycOsTLsxuY8VmnNRWvo8Cb5mfiNsY79Gq4XbANj34iz7RW3XasfxvBKr6Yz0S-42E1n-Gj0up_LKIxtL5-70h-Nu0lcFbbQVZi9MPz7rFgsIHGVT5cSV0ZBWPeqmEsNrc/s320/IMG_20190826_062110.jpg" alt="First slide">
    </div>
    <div class="carousel-item">
      <img class="d-block w-100" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheKVMs6pEN_NhrUM1F8AJA8s-6YabP4y_v9PVhPjaDVeP96oe1ZPgWcWyAdKoTisPkhp7wjBJkTAU3OLiIiK29ql9x-iyzlkZjvINkg-g9I-Hl9s-1OvnOsiTs1DCEWUhYxS29CcTI8AA/s320/IMG_20190826_062142.jpg" alt="Second slide">
    </div>
    <div class="carousel-item">
      <img class="d-block w-100" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbqub1dE2jdnEbXAwhAsstAOoK5jra_odkzwOawgn77JpqVOObpUQ7lvwHQmy1mKj9CLsWI3njmopUCWKkZ9Whw9IKlgaEW3RmchMTVMutFwHm_xQyC8fdrpUy0VurY4caQiaQgB2bbAQ/s320/Top-N-PUBG-Wallpapers-in-Full-HD-for-PC-and-Phone-2_4d470f76dc99e18ad75087b1b8410ea9.jpg" alt="Third slide">
    </div>
  </div>
  <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
    <span class="carousel-control-next-icon" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>
</body>
</html>

Comments

Popular posts from this blog

Node.js Cheat Sheet

Codeigniter ! Simple But Powerful

Introducing Cloudflare Pages ⚡