Responsive Auto-Slide Testimonials Using HTML, CSS & JavaScript animated website text, clean ui animation, css animation example, header animation, html typing effect, infinite text slider, javascript text loop, minimal text effect, text animation, typewriter animation

Responsive Auto-Slide Testimonials Using HTML, CSS & JavaScript

Testimonial Slider
dev code journey

"This product changed my life! It's the best investment I've ever made."

– Jane Doe
devcodejourney

"Fantastic support and a beautiful design. Highly recommended!"

– John Smith
devcode journey

"Simple to use and extremely effective. A+ experience."

– Alex Lee

In this tutorial, we’ll create an amazing auto-slide testimonial section using HTML, CSS, and JavaScript. This sleek and responsive design will automatically showcase client reviews or feedback in a smooth carousel format — perfect for websites, portfolios, or landing pages. Whether you’re a beginner or looking to polish your frontend skills, this project is a great way to practice DOM manipulation, CSS transitions, and responsive layouts.

Features:

  • Auto-sliding testimonial carousel

  • Clean and modern UI

  • Responsive design for all devices

  • Simple JavaScript logic

				
					<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Testimonial Slider</title>
  <style>
    .main {
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      margin: 0;
      padding: 0;
    }

    .slider-container {
      max-width: 600px;
      margin: 100px auto;
      background: white;
      padding: 40px;
      border-radius: 10px;
      box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
      position: relative;
      overflow: hidden;
    }

    .testimonial {
      display: none;
      text-align: center;
      transition: opacity 0.5s ease-in-out;
    }

    .testimonial.active {
      display: block;
    }

    .testimonial img.author-img {
      width: 100px;
      height: 100px;
      border-radius: 50%;
      object-fit: cover;
      margin-bottom: 20px;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    }

    .testimonial p {
      font-size: 18px;
      line-height: 1.6;
      color: #333;
      margin: 20px 0;
    }

    .testimonial .author {
      margin-top: 10px;
      font-weight: bold;
      color: #555;
    }

    .slider-buttons {
      text-align: center;
      margin-top: 30px;
    }

    .slider-buttons button {
      background: #3498db;
      border: none;
      color: white;
      padding: 10px 20px;
      margin: 0 10px;
      border-radius: 5px;
      cursor: pointer;
      font-size: 16px;
      transition: background 0.3s;
    }

    .slider-buttons button:hover {
      background: #2980b9;
    }
  </style>
</head>

<body>
  <div class="main">
    <div class="slider-container">
      <!-- Testimonials -->
      <div class="testimonial active">
        <img decoding="async" src="https://devcodejourney.com/wp-content/uploads/2025/05/Develop-Code-Journey-Watermark.png"
          alt="dev code journey" class="author-img" />
        <p>"This product changed my life! It's the best investment I've ever made."</p>
        <div class="author">– Jane Doe</div>
      </div>
      <div class="testimonial">
        <img decoding="async" src="https://devcodejourney.com/wp-content/uploads/2025/05/Develop-Code-Journey-Watermark.png"
          alt="devcodejourney" class="author-img" />
        <p>"Fantastic support and a beautiful design. Highly recommended!"</p>
        <div class="author">– John Smith</div>
      </div>
      <div class="testimonial">
        <img decoding="async" src="https://devcodejourney.com/wp-content/uploads/2025/05/Develop-Code-Journey-Watermark.png"
          alt="devcode journey" class="author-img" />
        <p>"Simple to use and extremely effective. A+ experience."</p>
        <div class="author">– Alex Lee</div>
      </div>

      <!-- Buttons -->
      <div class="slider-buttons">
        <button onclick="prevTestimonial()">Prev</button>
        <button onclick="nextTestimonial()">Next</button>
      </div>
    </div>
  </div>

  <script>
    let current = 0;
    const testimonials = document.querySelectorAll('.testimonial');

    function showTestimonial(index) {
      testimonials.forEach((testimonial, i) => {
        testimonial.classList.remove('active');
        if (i === index) {
          testimonial.classList.add('active');
        }
      });
    }

    function nextTestimonial() {
      current = (current + 1) % testimonials.length;
      showTestimonial(current);
    }

    function prevTestimonial() {
      current = (current - 1 + testimonials.length) % testimonials.length;
      showTestimonial(current);
    }

    setInterval(nextTestimonial, 5000); // Auto-slide every 5 seconds
  </script>
</body>

</html>