Skip to content
Loading
Image Slider using bootstrap  
  •       class="carousel-caption">  
  •         class="h3-responsive">Light mask  
  •         

    First text

      
  •         
  •       
  •     class="carousel-item">  
  •         
  •       class="view">  
  •         class="d-block w-100" src="https://mdbootstrap.com/img/Photos/Slides/img%20(6).jpg" alt="Second slide">  
  •         class="mask rgba-black-strong">  
  •         
  •       class="carousel-caption">  
  •         class="h3-responsive">Strong mask  
  •         

    Secondary text

      
  •         
  •       
  •     class="carousel-item">  
  •         
  •       class="view">  
  •         class="d-block w-100" src="https://mdbootstrap.com/img/Photos/Slides/img%20(9).jpg" alt="Third slide">  
  •         class="mask rgba-black-slight">  
  •         
  •       class="carousel-caption">  
  •         class="h3-responsive">Slight mask  
  •         

    Third text

      
  •         
  •       
  •     
  •     
  •     
  •   class="carousel-control-prev" href="#carousel-example-2" role="button" data-slide="prev">  
  •     class="carousel-control-prev-icon" aria-hidden="true">  
  •     class="sr-only">Previous  
  •     
  •   class="carousel-control-next" href="#carousel-example-2" role="button" data-slide="next">  
  •     class="carousel-control-next-icon" aria-hidden="true">  
  •     class="sr-only">Next  
  •     
  •     
  •   
  •   
  •  
    0
  • kindly refer this link ..hope this will help you.
     
    https://getbootstrap.com/docs/3.4/css/ 
    0
  • please go through following code:
     
    1. HTML
    1. <div class="container-banner">    
    2.     <div id="myCarousel" class="carousel slide" data-ride="carousel">    
    3.             
    4.         <ol class="carousel-indicators">    
    5.             <li data-target="#myCarousel" data-slide-to="0" class="active">li>    
    6.             <li data-target="#myCarousel" data-slide-to="1">li>    
    7.             <li data-target="#myCarousel" data-slide-to="2">li>    
    8.             <li data-target="#myCarousel" data-slide-to="3">li>    
    9.     
    10.         ol>    
    11.     
    12.             
    13.         <div class="carousel-inner">    
    14.             <div class="item active">    
    15.                 <img src="~/Content/img/hms5.jpg" style="width:100%; height:500px;">    
    16.             div>    
    17.     
    18.             <div class="item">    
    19.                 <img src="~/Content/img/hms13.jpg"  style="width:100%;height:500px;">    
    20.             div>    
    21.     
    22.             <div class="item">    
    23.                 <img src="~/Content/img/hsm3.jpg"  style="width:100%;height:500px;">    
    24.             div>    
    25.     
    26.             <div class="item">    
    27.                 <img src="~/Content/img/hms11.jpg" style="width:100%;height:500px;">    
    28.             div>    
    29.         div>    
    30.     
    31.             
    32.         <a class="left carousel-control" href="#myCarousel" data-slide="prev">    
    33.             <span class="glyphicon glyphicon-chevron-left">span>    
    34.             <span class="sr-only">Previousspan>    
    35.         a>    
    36.         <a class="right carousel-control" href="#myCarousel" data-slide="next">    
    37.             <span class="glyphicon glyphicon-chevron-right">span>    
    38.             <span class="sr-only">Nextspan>    
    39.         a>    
    40.     div>    
    41. div>   
    2. CSS
    1. .carousel {    
    2.     position: relative;    
    3. }    
    4.     
    5. .carousel-inner {    
    6.     position: relative;    
    7.     width: 100%;    
    8.     overflow: hidden;    
    9. }    
    10.     
    11.     .carousel-inner > .item {    
    12.         position: relative;    
    13.         display: none;    
    14.         -webkit-transition: 0.6s ease-in-out left;    
    15.         transition: 0.6s ease-in-out left;    
    16.     }    
    17.     
    18.         .carousel-inner > .item > img,    
    19.         .carousel-inner > .item > a > img {    
    20.             display: block;    
    21.             height: auto;    
    22.             max-width: 100%;    
    23.             line-height: 1;    
    24.         }    
    25.     
    26.     .carousel-inner > .active,    
    27.     .carousel-inner > .next,    
    28.     .carousel-inner > .prev {    
    29.         display: block;    
    30.     }    
    31.     
    32.     .carousel-inner > .active {    
    33.         left: 0;    
    34.     }    
    35.     
    36.     .carousel-inner > .next,    
    37.     .carousel-inner > .prev {    
    38.         position: absolute;    
    39.         top: 0;    
    40.         width: 100%;    
    41.     }    
    42.     
    43.     .carousel-inner > .next {    
    44.         left: 100%;    
    45.     }    
    46.     
    47.     .carousel-inner > .prev {    
    48.         left: -100%;    
    49.     }    
    50.     
    51.         .carousel-inner > .next.left,    
    52.         .carousel-inner > .prev.right {    
    53.             left: 0;    
    54.         }    
    55.     
    56.     .carousel-inner > .active.left {    
    57.         left: -100%;    
    58.     }    
    59.     
    60.     .carousel-inner > .active.right {    
    61.         left: 100%;    
    62.     }    
    63.     
    64. .carousel-control {    
    65.     position: absolute;    
    66.     top: 0;    
    67.     bottom: 0;    
    68.     left: 0;    
    69.     width: 15%;    
    70.     font-size: 20px;    
    71.     color: #ffffff;    
    72.     text-align: center;    
    73.     text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);    
    74.     opacity: 0.5;    
    75.     filter: alpha(opacity=50);    
    76. }    
    77.     
    78.     .carousel-control.left {    
    79.         background-image: -webkit-gradient(linear, 0 top, 100% top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.0001)));    
    80.         background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.5) 0), color-stop(rgba(0, 0, 0, 0.0001) 100%));    
    81.         background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0.0001) 100%);    
    82.         background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0.0001) 100%);    
    83.         background-repeat: repeat-x;    
    84.         filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);    
    85.     }    
    86.     
    87.     .carousel-control.right {    
    88.         right: 0;    
    89.         left: auto;    
    90.         background-image: -webkit-gradient(linear, 0 top, 100% top, from(rgba(0, 0, 0, 0.0001)), to(rgba(0, 0, 0, 0.5)));    
    91.         background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.0001) 0), color-stop(rgba(0, 0, 0, 0.5) 100%));    
    92.         background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0, rgba(0, 0, 0, 0.5) 100%);    
    93.         background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0, rgba(0, 0, 0, 0.5) 100%);    
    94.         background-repeat: repeat-x;    
    95.         filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);    
    96.     }    
    97.     
    98.     .carousel-control:hover,    
    99.     .carousel-control:focus {    
    100.         color: #ffffff;    
    101.         text-decoration: none;    
    102.         opacity: 0.9;    
    103.         filter: alpha(opacity=90);    
    104.     }    
    105.     
    106.     .carousel-control .icon-prev,    
    107.     .carousel-control .icon-next,    
    108.     .carousel-control .glyphicon-chevron-left,    
    109.     .carousel-control .glyphicon-chevron-right {    
    110.         position: absolute;    
    111.         top: 50%;    
    112.         left: 50%;    
    113.         z-index: 5;    
    114.         display: inline-block;    
    115.     }    
    116.     
    117.     .carousel-control .icon-prev,    
    118.     .carousel-control .icon-next {    
    119.         width: 20px;    
    120.         height: 20px;    
    121.         margin-top: -10px;    
    122.         margin-left: -10px;    
    123.         font-family: serif;    
    124.     }    
    125.     
    126.         .carousel-control .icon-prev:before {    
    127.             content: '\2039';    
    128.         }    
    129.     
    130.         .carousel-control .icon-next:before {    
    131.             content: '\203a';    
    132.         }    
    133.     
    134. .carousel-indicators {    
    135.     position: absolute;    
    136.     bottom: 10px;    
    137.     left: 50%;    
    138.     z-index: 15;    
    139.     width: 60%;    
    140.     padding-left: 0;    
    141.     margin-left: -30%;    
    142.     text-align: center;    
    143.     list-style: none;    
    144. }    
    145.     
    146.     .carousel-indicators li {    
    147.         display: inline-block;    
    148.         width: 10px;    
    149.         height: 10px;    
    150.         margin: 1px;    
    151.         text-indent: -999px;    
    152.         cursor: pointer;    
    153.         border: 1px solid #ffffff;    
    154.         border-radius: 10px;    
    155.     }    
    156.     
    157.     .carousel-indicators .active {    
    158.         width: 12px;    
    159.         height: 12px;    
    160.         margin: 0;    
    161.         background-color: #ffffff;    
    162.     }    
    163.     
    164. .carousel-caption {    
    165.     position: absolute;    
    166.     right: 15%;    
    167.     bottom: 20px;    
    168.     left: 15%;    
    169.     z-index: 10;    
    170.     padding-top: 20px;    
    171.     padding-bottom: 20px;    
    172.     color: #ffffff;    
    173.     text-align: center;    
    174.     text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);    
    175. }    
    176.     
    177.     .carousel-caption .btn {    
    178.         text-shadow: none;    
    179.     }    
    180.     
    181. @media screen and (min-width: 768px) {    
    182.     .carousel-control .icon-prev,    
    183.     .carousel-control .icon-next {    
    184.         width: 30px;    
    185.         height: 30px;    
    186.         margin-top: -15px;    
    187.         margin-left: -15px;    
    188.         font-size: 30px;    
    189.     }    
    190.     
    191.     .carousel-caption {    
    192.         right: 20%;    
    193.         left: 20%;    
    194.         padding-bottom: 30px;    
    195.     }    
    196.     
    197.     .carousel-indicators {    
    198.         bottom: 20px;    
    199.     }    
    200. }    
    201.     
    202. .clearfix:before,    
    203. .clearfix:after {    
    204.     display: table;    
    205.     content: " ";    
    206. }    
    207.     
    208. .clearfix:after {    
    209.     clear: both;    
    210. }   
    Thank you. 
    0
  • Farhan Ahmed
    https://www.c-sharpcorner.com/blogs/bootstrap-carousel-image-slider-with-database-in-asp-net2
    0
  • Use Bootstrap Carousel , see entire demo here Bootstrap 3 Carousel or Bootstrap 4 Carousel for version 4
    0
  • K P  Singh Chundawat
    Hi paresh gugale,

    following links might be help you 

    http://bootstrapbay.com/blog/bootstrap-3-carousel-tutorial/


    http://startbootstrap.com/template-overviews/full-slider/

    Thanks 

    KP Singh  

    ----------------------------------------------------------------------------------------------------------
      (if this post is help you then dont forget to mark is as 'Accepted Answer')
    0