responsive testimonial section with HTML and Grid CSS
Design comparison
Solution retrospective
Proud that i was able to decipher this in way less time than i thought!
What challenges did you encounter, and how did you overcome them?my grid sizing
What specific areas of your project would you like help with?nothing
Community feedback
- @DarekReposPosted 7 months ago
Greetings! Great job!
I have one small additional suggestion. In addition to setting the container wrapper and width value, it's also best to set a defined height value.
check this example:
body { <div class="wrapper"> <main></main> <footer></footer> </div> } .wrapper { display: flex; justify-content: center; align-items: center; max-width: 1400px; flex-direction: column; margin: auto; height: 100vh; height: 100dvh; }
You can use the dvh unit (it will resolve some issues with mobile devices), but it's not currently supported by all browsers. If a browser doesn't support 100dvh, it will fallback to using 100vh instead.
The dvh unit seems to be the best choice. We are sure that:
- containers will occupy 100% of the available vertical space,
- they will definitely fit when the page loads,
- they will enlarge during page scrolling and therefore change their size.
You might be wondering now: why use lvh and svh when dvh combines the best features of both?
Using dvh will change the height of elements during scrolling - when we display the page and the browser interface elements are visible, the container height will be smaller. When we start scrolling and the interface elements hide, the container height will be larger.
There are many resources about height and optimal solutions, such as this video: link: https://www.youtube.com/watch?v=veEqYQlfNx8.
I hope you find this helpful. Keep coding (and happy coding too!)
Marked as helpful0 - @tufcoderPosted 7 months ago
I have some observations about your code:
- Use more semantic tags like
section
orarticle
insteaddiv
. - To a better sizing, try put the grid in a container/wrapper, so you could adjust the width.
Well done, keep coding!
0 - Use more semantic tags like
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