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  
  •     
  •     
  •   
  •   
  •  
  • kindly refer this link ..hope this will help you.
     
    https://getbootstrap.com/docs/3.4/css/ 
  • 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.     positionrelative;    
    3. }    
    4.     
    5. .carousel-inner {    
    6.     positionrelative;    
    7.     width100%;    
    8.     overflowhidden;    
    9. }    
    10.     
    11.     .carousel-inner > .item {    
    12.         positionrelative;    
    13.         displaynone;    
    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.             displayblock;    
    21.             heightauto;    
    22.             max-width100%;    
    23.             line-height1;    
    24.         }    
    25.     
    26.     .carousel-inner > .active,    
    27.     .carousel-inner > .next,    
    28.     .carousel-inner > .prev {    
    29.         displayblock;    
    30.     }    
    31.     
    32.     .carousel-inner > .active {    
    33.         left: 0;    
    34.     }    
    35.     
    36.     .carousel-inner > .next,    
    37.     .carousel-inner > .prev {    
    38.         positionabsolute;    
    39.         top: 0;    
    40.         width100%;    
    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.     positionabsolute;    
    66.     top: 0;    
    67.     bottom: 0;    
    68.     left: 0;    
    69.     width15%;    
    70.     font-size20px;    
    71.     color#ffffff;    
    72.     text-aligncenter;    
    73.     text-shadow0 1px 2px rgba(0000.6);    
    74.     opacity: 0.5;    
    75.     filter: alpha(opacity=50);    
    76. }    
    77.     
    78.     .carousel-control.left {    
    79.         background-image: -webkit-gradient(linear, 0 top100% top, from(rgba(0000.5)), to(rgba(0000.0001)));    
    80.         background-image: -webkit-linear-gradient(left, color-stop(rgba(0000.50), color-stop(rgba(0000.0001100%));    
    81.         background-image: -moz-linear-gradient(left, rgba(0000.50, rgba(0000.0001100%);    
    82.         background-image: linear-gradient(to right, rgba(0000.50, rgba(0000.0001100%);    
    83.         background-repeatrepeat-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 top100% top, from(rgba(0000.0001)), to(rgba(0000.5)));    
    91.         background-image: -webkit-linear-gradient(left, color-stop(rgba(0000.00010), color-stop(rgba(0000.5100%));    
    92.         background-image: -moz-linear-gradient(left, rgba(0000.00010, rgba(0000.5100%);    
    93.         background-image: linear-gradient(to right, rgba(0000.00010, rgba(0000.5100%);    
    94.         background-repeatrepeat-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-decorationnone;    
    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.         positionabsolute;    
    111.         top: 50%;    
    112.         left: 50%;    
    113.         z-index5;    
    114.         display: inline-block;    
    115.     }    
    116.     
    117.     .carousel-control .icon-prev,    
    118.     .carousel-control .icon-next {    
    119.         width20px;    
    120.         height20px;    
    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.     positionabsolute;    
    136.     bottom: 10px;    
    137.     left: 50%;    
    138.     z-index15;    
    139.     width60%;    
    140.     padding-left0;    
    141.     margin-left-30%;    
    142.     text-aligncenter;    
    143.     list-stylenone;    
    144. }    
    145.     
    146.     .carousel-indicators li {    
    147.         display: inline-block;    
    148.         width10px;    
    149.         height10px;    
    150.         margin1px;    
    151.         text-indent-999px;    
    152.         cursorpointer;    
    153.         border1px solid #ffffff;    
    154.         border-radius: 10px;    
    155.     }    
    156.     
    157.     .carousel-indicators .active {    
    158.         width12px;    
    159.         height12px;    
    160.         margin0;    
    161.         background-color#ffffff;    
    162.     }    
    163.     
    164. .carousel-caption {    
    165.     positionabsolute;    
    166.     right: 15%;    
    167.     bottom: 20px;    
    168.     left: 15%;    
    169.     z-index10;    
    170.     padding-top20px;    
    171.     padding-bottom20px;    
    172.     color#ffffff;    
    173.     text-aligncenter;    
    174.     text-shadow0 1px 2px rgba(0000.6);    
    175. }    
    176.     
    177.     .carousel-caption .btn {    
    178.         text-shadownone;    
    179.     }    
    180.     
    181. @media screen and (min-width768px) {    
    182.     .carousel-control .icon-prev,    
    183.     .carousel-control .icon-next {    
    184.         width30px;    
    185.         height30px;    
    186.         margin-top-15px;    
    187.         margin-left-15px;    
    188.         font-size30px;    
    189.     }    
    190.     
    191.     .carousel-caption {    
    192.         right: 20%;    
    193.         left: 20%;    
    194.         padding-bottom30px;    
    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.     clearboth;    
    210. }   
    Thank you. 
  • Farhan Ahmed
    https://www.c-sharpcorner.com/blogs/bootstrap-carousel-image-slider-with-database-in-asp-net2
  • Use Bootstrap Carousel , see entire demo here Bootstrap 3 Carousel or Bootstrap 4 Carousel for version 4
  • 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')