How to Create Floating Testimonial in Bootstrap ? Last Updated : 30 Jul, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article, we will explore how to create an advanced floating testimonial using Bootstrap. We will guide you through setting up the HTML structure, applying Bootstrap classes for styling, and implementing smooth floating effects with CSS. This technique enhances the visual appeal of testimonials, making them dynamic and engaging.PrerequisitesBasic Understanding of HTML and CSSBootstrapApproachHTML Structure Setup: Begin by creating the basic HTML structure for the testimonial, including necessary Bootstrap classes for responsive design and layout.Styling with CSS: Apply custom CSS to style the testimonial box, adding padding, shadows, and rounded corners for a polished look. Use pseudo-elements for decorative floating circles.Animation Implementation: Use CSS animations to create a smooth floating effect, defining keyframes to move the testimonial box up and down continuously.Example: This example shows the implementation of the above-explained approach. HTML <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Floating Testimonial</title> <link href= "https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"> <style> .navbar { display: flex; justify-content: space-between; align-items: center; background-color: #2e2e2e; padding: 10px 20px; color: #fff; } .navbar img { max-width: 200px; display: block; margin: 0 auto; } body { background-color: #f8f9fa; } .testimonial { position: relative; max-width: 400px; margin: 40px auto; padding: 30px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); background-color: #fff; border-radius: 10px; overflow: hidden; animation: float 3s ease-in-out infinite; } @keyframes float { 0% { transform: translateY(0); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0); } } .testimonial::before, .testimonial::after { content: ''; position: absolute; width: 100px; height: 100px; border-radius: 50%; background-color: rgba(0, 0, 0, 0.05); z-index: -1; animation: float 6s ease-in-out infinite; } .testimonial::before { top: -50px; left: -50px; } .testimonial::after { bottom: -50px; right: -50px; animation-delay: 3s; } .testimonial p { font-size: 18px; color: #333; margin-bottom: 20px; } .testimonial .author { display: flex; align-items: center; } .testimonial .author img { width: 50px; height: 50px; border-radius: 50%; margin-right: 15px; } .testimonial .author .name { font-weight: bold; font-size: 16px; color: #007bff; } .testimonial .author .title { font-size: 14px; color: #555; } </style> </head> <body> <nav class="navbar"> <img src= "https://media.geeksforgeeks.org/gfg-gg-logo.svg" alt="Logo"> </nav> <div class="container"> <div class="testimonial text-center"> <p>"Bootstrap is incredibly powerful and versatile. I use it in all my projects!"</p> <div class="author"> <img src="https://via.placeholder.com/50" alt="Author"> <div> <div class="name">John Doe</div> <div class="title">Web Developer</div> </div> </div> </div> </div> <script src= "https://code.jquery.com/jquery-3.5.1.slim.min.js"> </script> <script src= "https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"> </script> <script src= "https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"> </script> </body> </html> Output: Comment More infoAdvertise with us Next Article How to Create Floating Testimonial in Bootstrap ? A ashishrettgg Follow Improve Article Tags : Web Technologies Bootstrap Bootstrap-Questions Similar Reads How to Create Testimonial Slider in Bootstrap? Testimonial Sliders are interactive components in web design, often used to display multiple images or content sequentially. They're useful for showcasing testimonials of the students or users one after another. Here, we will see how to create a testimonial Slider in Bootstrap 5. ApproachFirst, crea 4 min read How to create a FAQ Section in Bootstrap ? An FAQ(Frequently Asked Questions) section serves as a valuable resource for users, providing them with the information they need in a convenient and accessible manner while also benefiting the organization by reducing support overhead and enhancing user satisfaction.Table of Content Using Accordion 4 min read How to Create a Dark Themed User Testimonial in Bootstrap ? Incorporating user testimonials into your website using Bootstrap 5 is an effective way to showcase positive feedback and build customer trust. With Bootstrap 5's flexible styling options, you can easily customize the appearance of testimonials to align with your brand's aesthetic while maintaining 3 min read How to Create a Sticky Footer in Bootstrap? In any webpage footer is the section that occurs at the end of the page. In many web pages, we can see that footers are sticky which means that whether we scroll up or down the page the footer will stay in its place which is at the bottom of the page.How to implement a sticky footer using BootstrapI 5 min read How to create a Testimonial Section with Star Ratings in Bootstrap ? The Testimonial section with star ratings in Bootstrap serves to showcase client feedback and ratings, enhancing user interaction. It provides a visually appealing carousel format, suitable for business websites, e-commerce platforms, and service-based websites. This project combines Bootstrap's res 5 min read Like