Design comparison
SolutionDesign
Solution retrospective
I had some trouble at first center aligning the content, what are some best practices to allign content on a page?
Community feedback
- @Yaser47Posted over 2 years ago
Good work pro
- if you want to central the main tag horizontal and vertical, now you don't need to margin-top in .square body { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
- And you are using the the wrong background-color.
- And you can give the all element padding/ margin= zero, and if you want to modified any of them you can give specific value of top or bottom or right or left
- { padding: 0; margin: 0; }
0 - @indraAKPosted over 2 years ago
to centering the first content, set height body and html to 100%, and then for class main add some properties min-height: 100%; display: grid; place-content: center; and also remove the margin-top for class message.
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