Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 10 months ago

A responsive social proof section on a landing page

pure-css
Lutfi Ismail•150
@lutfiismail52
A solution to the Social proof section challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What specific areas of your project would you like help with?

Is my way of positioning the testimonial and rating sections correct using the CSS property position: relative;. Maybe there is a better and more efficient way? Here is more or less an example of my code:

<div class="top-section-ratings">
 <div class="rating">
   <div class="rating-starts">
     <img src="./images/icon-star.svg" alt="star icon">
     <img src="./images/icon-star.svg" alt="star icon">
     <img src="./images/icon-star.svg" alt="star icon">
     <img src="./images/icon-star.svg" alt="star icon">
     <img src="./images/icon-star.svg" alt="star icon">
   </div>
 <p class="rating-text">Rated 5 Stars in Reviews</p>
 </div>
 </div>
 </section>

 <!-- Testimonials Section -->
 <section class="testimonials">
   <div class="testimonial">
     <div class="testimonial-header">
     <img class="testimonial-image" src="./images/image-colton.jpg" alt="Colton Smith">
     <div class="testimonial-user">
       <p class="testimonial-name">Colton Smith</p>
       <p class="testimonial-role">Verified Buyer</p>
     </div>
   </div>
   <p class="testimonial-text">
 "We needed the same printed design as the one we had ordered a week before.
 Not only did they find the original order, but we also received it in time.
 Excellent!"
 </p>
 </div>
@media screen and (min-width: 768px) {
 .top-section-ratings> :nth-child(1) {
 position: relative;
 left: -40px;
 }

 .top-section-ratings> :nth-child(2) {
 position: relative;
 left: -20px;
 }

 .rating {
 width: 400px;
 flex-direction: row;
 justify-content: center;
 align-items: center;
 gap: 8px;
 }

 .testimonials {
 display: flex;
 gap: 16px;
 }

 .testimonials> :nth-child(2) {
 position: relative;
 top: 10px;
 }

 .testimonials> :nth-child(3) {
position: relative;
top: 20px;
}
}

Thank you for taking the time to help me with this question, I really appreciate it! 😊

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Lutfi Ismail's solution.

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License