"Responsive slider Demo "
Bootstrap 4.1.1 Snippet by prakash27dec

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="slider"> <div class="slide slide1"> <div class="caption"> <h2>Slide1</h2> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> </div> </div> <div class="slide slide2"> <div class="caption"> <h2>Slide2</h2> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> </div> </div> <div class="slide slide3"> <div class="caption"> <h2>Slide3</h2> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> </div> </div> <div class="slide slide4"> <div class="caption"> <h2>Slide4</h2> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> </div> </div> <div class="slide slide1"> <div class="caption"> <h2>Slide1</h2> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> </div> </div> </div> </div>
body { margin: 0; padding: 0; font-family: sans-serif; } .container { position: relative; overflow: hidden; width: 100%; height: 100vh; } .container .slider { position: absolute; top: 0; left: 0; width: 500%; height: 100%; animation: animate 10s linear infinite; } .container .slider .slide { position: relative; width: 20%; height: 100%; float: left; } .container .slider .slide .caption { position: absolute; bottom: 60px; right: 60px; left: 60px; padding: 30px; background-color: rgba(0,0,0,.5); box-sizing:border-box; transition: 0.5s; } .container .slider .slide .caption h2 { margin: 0; padding: 0; color: #fff; font-size: 48px; transition: 0.5s; } .container .slider .slide .caption p { margin: 0; padding: 0; color: #fff; font-size: 18px; transition: 0.5s; } .container .slider .slide.slide1 { background: url(https://www.planwallpaper.com/static/images/47141475-hd-wallpapers.jpg); background-size: cover; background-position: center; } .container .slider .slide.slide2 { background: url(https://www.planwallpaper.com/static/images/963840d34c51efe6fbe57749fb434646.jpg); background-size: cover; background-position: center; } .container .slider .slide.slide3 { background: url(https://www.planwallpaper.com/static/images/HD-Wallpapers-B1.jpg); background-size: cover; background-position: center; } .container .slider .slide.slide4 { background: url(https://www.planwallpaper.com/static/images/beach-cool-wallpaper-hd_1_tKvqLtf.jpg); background-size: cover; background-position: center; } @keyframes animate { 0% { left: 0; } 20% { left: 0; } 25% { left: -100%; } 45% { left: -100%; } 50% { left: -200%; } 70% { left: -200%; } 75% { left: -300%; } 95% { left: -300%; } 100% { left: -400%; } } @media screen and (max-width: 768px) { .container .slider .slide .caption { bottom: 20px; right: 20px; left: 20px; padding: 20px; } .container .slider .slide .caption h2 { margin: 0 0 10px; font-size: 30px; } .container .slider .slide .caption p { font-size: 16px; } }

Related: See More


Questions / Comments: