Create Responsive Text Slideshow Using HTML And CSS

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy

- Someone's Name

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been.

- Someone's Name

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy

- Someone's Name

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been.

- Someone's Name

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown.

- Someone's Name

Its features:

  • It is completely responsive.

  • It can be used as a quotes text banner.

  • You can use your company's ads on each of the five slides.

  • You can change the model color via CSS if you want.

Try to create like yourself by following the codes below :


Step 1) Add to head :
<meta name="viewport" content="width=device-width, initial-scale=1">
Step 2) Add to html :
<h2>Create Responsive Text Slideshow With HTML And CSS</h2> <div class="slideshow-container"> <div class="mySlides"> <q>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy</q> <p class="author">- Someone's Name</p> </div> <div class="mySlides"> <q>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been. </q> <p class="author">- Someone's Name</p> </div> <div class="mySlides"> <q>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy</q> <p class="author">- Someone's Name</p> </div> <div class="mySlides"> <q>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been. </q> <p class="author">- Someone's Name</p> </div> <div class="mySlides"> <q>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown.</q> <p class="author">- Someone's Name</p> </div> <a class="prev" onclick="plusSlides(-1)">&#8666</a> <a class="next" onclick="plusSlides(1)">&#8667</a> </div> <div class="dot-container"> <span class="dot" onclick="currentSlide(1)"></span> <span class="dot" onclick="currentSlide(2)"></span> <span class="dot" onclick="currentSlide(3)"></span> <span class="dot" onclick="currentSlide(3)"></span> <span class="dot" onclick="currentSlide(3)"></span> </div>
Step 3) Add to css :
* {box-sizing: border-box} .slideshow-container { position: relative; background: #eee; border:10px solid gray; } .mySlides { display: none; padding: 80px; text-align: center; } .prev, .next { cursor: pointer; position: absolute; top: 41%; width: auto; margin-top: -30px; padding: 16px; color: #888; font-weight: bold; font-size: 50px; border-radius: 0 3px 3px 0; user-select: none; } .next { position: absolute; right: 0; border-radius: 3px 0 0 3px; } .prev:hover, .next:hover { color: red; } .dot-container { text-align: center; padding: 20px; background-image: linear-gradient(#bbb, #ddd, #bbb); } .dot { cursor: pointer; height: 15px; width: 15px; margin: 0 2px; background-color: #bbb; border-radius: 50%; display: inline-block; transition: background-color 0.6s ease; } .active, .dot:hover { background-color: #717171; } q {font-style: italic;} .author {color:green;}
Step 4) Add to script :
<script> var slideIndex = 1; showSlides(slideIndex); function plusSlides(n) { showSlides(slideIndex += n); } function currentSlide(n) { showSlides(slideIndex = n); } function showSlides(n) { var i; var slides = document.getElementsByClassName("mySlides"); var dots = document.getElementsByClassName("dot"); if (n > slides.length) {slideIndex = 1} if (n < 1) {slideIndex = slides.length} for (i = 0; i < slides.length; i++) { slides[i].style.display = "none"; } for (i = 0; i < dots.length; i++) { dots[i].className = dots[i].className.replace(" active", ""); } slides[slideIndex-1].style.display = "block"; dots[slideIndex-1].className += " active"; } </script>



Thank you sir

Congratulations to you on visiting our page.

If you have any feedback, you can give advice through the "Contact Me" form.