Design comparison
Solution retrospective
Maybe I can frame the divs better
What challenges did you encounter, and how did you overcome them?Media query, Responsive design
What specific areas of your project would you like help with?Css grid
Community feedback
- @justinconnellPosted 8 months ago
Hi @vitorialrd,
Congratulations on submitting your solution!
I noticed that you did use flexbox in your solution and thought the following resources will be helpful - I included CSS Grid because you asked about grid:
- FlexBox documented here
- or CSS Grid documented here
The trick is to have a container that takes up
100vh
(100% of the viewport height) and100vw
(100% viewport width) and then to centre the child element in the container element.In your code this can be done with the following changes:
body { background-color: hsl(212, 45%, 89%); font-family: "Outfit", sans-serif; /* margin-top: 40px; */ } .container { /* display: block; */ /* margin: auto; */ height: 100vh; display: flex; /* align item vertically */ align-items: center; /* align item horizontally */ justify-content: center; }
Note, I commented out the unnecessary code above and included some comments on centring the content for convenience.
To answer your question on CSS Grid, you can achieve the same effect as follows:
.container { height: 100vh; display: grid; place-content: center; }
I hope you find this feedback helpful
Keep on coding! J
0
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