Design comparison
Solution retrospective
- The area I found difficult was trying to align the box to the center, had to use the margin property to place all the element n one line.
Community feedback
- @Enmanuel-Otero-MontanoPosted over 2 years ago
Hello Georgeinnerside!
In this type of design, where there is only one child element of the body, the ideal is that you give the body a minimum height of 100vh, so you make sure that the body will measure at least the entire height of the screen where it is visualizing. You must also apply the following properties to the body
display: flex; justify-content: center; align-items: center;
But reviewing your code and the structure of the HTML, those styles should be applied to the div with the overall-container class. This way the child element of overall-container will be centered both vertically and horizontally and you won't have to be using margin to center. It should be like this:
.overall-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
Cheers!
0@GeorgeinnersidePosted over 2 years ago@Enmanuel-Otero-Montano thank you so much, I will work on it
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