Responsive Testimonials using Grid and media queries

Solution retrospective
I'm most proud of how I used CSS Grid with nth-child selectors to precisely position each testimonial card across multiple breakpoints. It was really satisfying to see the layout adapt fluidly across devices, from mobile to widescreen. I'm also proud of how I used em units for breakpoints to improve accessibility and scalability of the layout.
If I were to do this challenge again, I would spend more time organizing and reusing utility classes to reduce redundancy in my CSS. I might also experiment with using clamp() for more fluid typography and spacing. I played with it last challenge but want to dive further into the concept.
What challenges did you encounter, and how did you overcome them?One of the biggest challenges was getting the grid layout to match the design at different screen widths, especially for the tablet and desktop breakpoints. Using grid-template-areas at first felt limiting, so I leaned into manual grid positioning with nth-child, which gave me finer control.
I also had trouble applying a semi-transparent box-shadow using HSL with CSS variables. I learned that to interpolate (a new word for me!) an alpha value into an HSL color, the custom property must be defined without the hsl() wrapper, just the raw values. While I simply used the :root value I created instead, I'm going to try this with the next challenge that uses box-shadow.
What specific areas of your project would you like help with?I'd appreciate feedback on:
My use of em units for media queries...are there best practices for choosing the base value?
Whether my grid positioning using nth-child is maintainable or if there’s a cleaner way to handle this for large-scale layouts.
How I could improve my utility class naming or structure for scalability and clarity.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @chrislara01
Great work! Here are some tips that I think that could improve your solution:
- Line height: Looking at the text, looks that you could use some more line height using this exact CSS property
line-height
to separate the lines of the paragraph element in the testimonial cards. - Box Shadow: Since box shadows often are very subtle I tent to use
rgba(0, 0, 0, 0.1)
or where the first values are the RGB part indicating a black color and the last as a opacity value, being 1 full opacity and 0 transparent. To match the design seems like there is a lot of displacement in both right and bottom values and blur radius that I think that are missing. You could also play with smaller offset values and using the spread radius (fourth parameter).
On feedback:
- Using
em
values for media queries is a very standard and used approach so this was a great use of them! - Your approach to the grid positioning was great! Often times may look complicated but sometimes it has to be.
- Your approach to utility class naming was great!
This was an excellent solution! Hope this helps!
- Line height: Looking at the text, looks that you could use some more line height using this exact CSS property
- P@j3dd3rs
Your design looks good! Well done on applying the different layouts using the media queries.
Looking at your CSS, you can reduce the need for listing every single element and removing the margin with your universal selector (* {) instead.
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