Today, In this blog you’ll learn how we can create a user testimonials for websites. This testimonials design can be used if you’re selling a product on your website, customer testimonials can be a key content element because they are unbiased comments that prompt visitors to buy. By using testimonials in text formats on your site, you introduce content that will promote your product in convincing fashion.
Where Should You Put Customer Testimonials on a Website?
Many businesses include them on their homepages. Since lots of people find businesses through Google search and land on homepages, this strategy can work well.
Other excellent places to include customer testimonials include the following:
Landing pages
Sales pages
Exit-intent popups
Contact pages
Underneath blog posts
In the sidebar
However, you won’t know what area is most effective until you collect data.
You May Also Like:
- Strong Random Password Generator Using Javascript
- Take Image Snapshot from a webcam with Jquery and HTML
- Pure CSS Animated Background
- How to decode JSON data and accessing the results in PHP
- Difference Between search() and indexOf() in Javascript
- Limit number of login attempt using PHP & MySQL
First of all, we create an HTML file
The HTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Testimonial Design</title> <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.2/css/all.min.css'> <link rel='stylesheet' href='style.css'> </head> <body translate="no"> <div class="testimonials-container"> <i class="fas fa-quote-left"></i> <p class="text"></p> <strong class="name"></strong> <div class="authors-container"> <div class="author selected"><img src="https://randomuser.me/api/portraits/men/41.jpg" alt=""></div> <div class="author"><img src="https://randomuser.me/api/portraits/women/50.jpg" alt=""></div> <div class="author"><img src="https://randomuser.me/api/portraits/women/22.jpg" alt=""></div> <div class="author"><img src="https://randomuser.me/api/portraits/women/76.jpg" alt=""></div> <div class="author"><img src="https://randomuser.me/api/portraits/men/17.jpg" alt=""></div> </div> </div> <div class="social-panel-container"> <div class="social-panel"> <p>Created with <i class="fa fa-heart"></i> by <a target="_blank" href="https://florin-pop.com">Florin Pop</a></p> <button class="close-btn"><i class="fas fa-times"></i></button> <h4>Get in touch on</h4> <ul> <li> <a href="https://www.patreon.com/florinpop17" target="_blank"> <i class="fab fa-discord"></i> </a> </li> <li> <a href="https://twitter.com/florinpop1705" target="_blank"> <i class="fab fa-twitter"></i> </a> </li> <li> <a href="https://linkedin.com/in/florinpop17" target="_blank"> <i class="fab fa-linkedin"></i> </a> </li> <li> <a href="https://facebook.com/florinpop17" target="_blank"> <i class="fab fa-facebook"></i> </a> </li> <li> <a href="https://instagram.com/florinpop17" target="_blank"> <i class="fab fa-instagram"></i> </a> </li> </ul> </div> </div> <script src="main.js"></script> </body> </html> |
The CSS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
@import url('https://fonts.googleapis.com/css?family=Muli&display=swap'); @import url('https://fonts.googleapis.com/css?family=Roboto:400,700&display=swap'); * { box-sizing: border-box; } body { background: #D3CCE3; background: -webkit-linear-gradient(to bottom, #E9E4F0, #D3CCE3); background: linear-gradient(to bottom, #E9E4F0, #D3CCE3); font-family: 'Roboto', sans-serif; display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; } .testimonials-container { color: rgba(255, 255, 255, 0.8); display: flex; flex-direction: column; align-items: center; padding: 70px 200px 50px; transition: all 0.3s ease-in; max-width: 100%; } .fa-quote-left { color: rgba(0, 0, 0, 0.15); font-size: 50px; } .text { line-height: 30px; margin: 40px 0 20px; min-height: 150px; max-width: 100%; text-align: justify; word-spacing: 5px; } .name { align-self: flex-end; font-weight: bold; letter-spacing: 2px; text-transform: uppercase; } .authors-container { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; } .author { margin: 30px 30px 0; cursor: pointer; } .author.selected img { box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5); transform: scale(1.2); } .author img { transition: all 0.3s ease-in; border-radius: 50%; width: 50px; height: 50px; } /* SOCIAL PANEL CSS */ .social-panel-container { position: fixed; right: 0; bottom: 80px; transform: translateX(100%); transition: transform 0.4s ease-in-out; } .social-panel-container.visible { transform: translateX(-10px); } .social-panel { background-color: #fff; border-radius: 16px; box-shadow: 0 16px 31px -17px rgba(0,31,97,0.6); border: 5px solid #001F61; display: flex; flex-direction: column; justify-content: center; align-items: center; font-family: 'Muli'; position: relative; height: 169px; width: 370px; max-width: calc(100% - 10px); } .social-panel button.close-btn { border: 0; color: #97A5CE; cursor: pointer; font-size: 20px; position: absolute; top: 5px; right: 5px; } .social-panel button.close-btn:focus { outline: none; } .social-panel p { background-color: #001F61; border-radius: 0 0 10px 10px; color: #fff; font-size: 14px; line-height: 18px; padding: 2px 17px 6px; position: absolute; top: 0; left: 50%; margin: 0; transform: translateX(-50%); text-align: center; width: 235px; } .social-panel p i { margin: 0 5px; } .social-panel p a { color: #FF7500; text-decoration: none; } .social-panel h4 { margin: 20px 0; color: #97A5CE; font-family: 'Muli'; font-size: 14px; line-height: 18px; text-transform: uppercase; } .social-panel ul { display: flex; list-style-type: none; padding: 0; margin: 0; } .social-panel ul li { margin: 0 10px; } .social-panel ul li a { border: 1px solid #DCE1F2; border-radius: 50%; color: #001F61; font-size: 20px; display: flex; justify-content: center; align-items: center; height: 50px; width: 50px; text-decoration: none; } .social-panel ul li a:hover { border-color: #FF6A00; box-shadow: 0 9px 12px -9px #FF6A00; } .floating-btn { border-radius: 26.5px; background-color: #001F61; border: 1px solid #001F61; box-shadow: 0 16px 22px -17px #03153B; color: #fff; cursor: pointer; font-size: 16px; line-height: 20px; padding: 12px 20px; position: fixed; bottom: 20px; right: 20px; z-index: 999; } .floating-btn:hover { background-color: #ffffff; color: #001F61; } .floating-btn:focus { outline: none; } .floating-text { background-color: #001F61; border-radius: 10px 10px 0 0; color: #fff; font-family: 'Muli'; padding: 7px 15px; position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); text-align: center; z-index: 998; } .floating-text a { color: #FF7500; text-decoration: none; } @media screen and (max-width: 480px) { .social-panel-container.visible { transform: translateX(0px); } .floating-btn { right: 10px; } } |
The JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
const authorsEl = document.querySelectorAll('.author'); const container = document.querySelector('.testimonials-container'); const nameEl = document.querySelector('.name'); const textEl = document.querySelector('.text'); const testimonials = [{ text: '“I just wanted to share a quick note and let you know that you guys do a really good job. I’m glad I decided to work with you. It’s really great how easy your websites are to update and manage. I never have any problem at all. My new site is so much faster and easier to work with than my old site. It used to take me an hour or more to update a page and I would still sometimes screw things up. Now it’s almost like having a designer right here with me. I just choose the page, make the change and click save. It’s so simple. Thanks, guys!”', name: 'Phoebe Kotliar', color: 'rgba(32, 191, 107,1.0)' }, { text: '“You made it so simple. My new site is so much faster and easier to work with than my old site. I just choose the page, make the change and click save. Thanks, guys!”', name: 'Arthur Birnbaum', color: 'rgba(250, 130, 49,1.0)' }, { text: 'Their work on our website and Internet marketing has made a significant different to our business. We’ve seen a 425% increase in quote requests from the website which has been pretty remarkable – but I’d always like to see more!', name: 'Louisa P. Huard', color: 'rgba(75, 123, 236,1.0)' }, { text: 'When it comes to digital marketing there are loads of commentators that talk a good game, but Sonja and Sharon help you make it happen. They have enabled me, coached me and given me the confidence to share Wealth Horizon’s story widely. It’s engaging customers and industry commentators alike, and bringing our new business great results.', name: 'Cristina Aurmoogum', color: 'rgba(165, 94, 234,1.0)' }, { text: 'I hired Florin Pop based on others positive experiences, and I understand why he\'s so highly rated. His code is very clean, he communicates well, and he likes to offer alternative solutions.', name: 'J. Kent Pepper', color: 'rgba(235, 59, 90,1.0)' }]; addTestimonial(0); authorsEl.forEach((author, idx) => { author.addEventListener('click', e => { addTestimonial(idx); author.classList.add('selected'); }); }); function addTestimonial(idx) { const testimonial = testimonials[idx]; nameEl.innerHTML = testimonial.name; textEl.innerHTML = testimonial.text; container.style.background = testimonial.color; container.style.boxShadow = `0 35px 10px -20px ${testimonial.color.substring(0, testimonial.color.length - 4)}0.9)`; authorsEl.forEach(author => { author.classList.remove('selected'); }); } |
Thank you for reading this blog, share this blog as much as possible and also show it to your friends. If you have any questions, feel free to comment.