Somewhat responsive testimonial section HTML and CSS
Design comparison
Solution retrospective
First time using css grids in a project, although it looks fine on mobile screens, the height and width of the boxes on a bigger screen is uneven. Any tips on how to fix it is appreciated.
Community feedback
- @emestabilloPosted over 3 years ago
Hi B@i$ya, for the desktop view: if you unset
align-items: center
from your.container
and adjust Kira's grid-row from 1/4 to 1/3, they should all line up nicely. In addition, I suggest adjusting (or removing) all the margins on.container
and use flexbox to center the component. Try this onbody
:display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh;
-
For smaller screens, I recommend applying
max-width
on the grid container so that it doesn't touch the left and right gutters and will also avoid stretching of the testimonials. -
The semantics can also be improved. I noticed the heading tags start with h5 and jump to h3. Best practice would be to start with a single h1, and the numbers get smaller as you go through the document. There are divs here as well that could be exchanged for more meaningful tags. I suggest having a look at Grace's solution and here's an article as an overview.
Hope this helps!
Marked as helpful1 -
Please log in to post a comment
Log in with GitHubJoin 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