Design comparison
Solution retrospective
.
What challenges did you encounter, and how did you overcome them?.
What specific areas of your project would you like help with?.
Community feedback
- @porumbachanovPosted 6 months ago
There is no need for the
margin: 18% auto;
in the.container
as it needlessly stretches the window. Instead, you can center the items using flexbox by adding the following lines in the"body"
:display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh;
display: flex;
Enables the flexbox layout.flex-direction: column;
Specifies the flex container's main axis to column, which means that the child elements will be laid out vertically.align-items: center;
Centers the items horizontally.justify-content: center;
Centers the items vertically within the container.height: 100vh;
Sets the height of the "body" element to occupy the full height of the viewport ("vh" stands for viewport height).Hope this helps :).
Marked as helpful1@atheenaoteyzaPosted 6 months ago@Vrondir wasn't really gonna use flex here but yea I should have even just for the container to center it thanks!
1
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