Design comparison
Solution retrospective
What are best practices for sizing elements ?
Should I still use layouts like flexbox and css grid for even simple sites like this one ?
Community feedback
- @Dan-KantPosted over 2 years ago
Good day Kayla, here are some ways you can improve your code. In order to center an element both horizontally and vertically give your body or a parent element min-height: 100vh; display: flex; justify-content: center; align-items: center; . Now, to proceed with your questions. You can use relative size units like rem, em with max-width which will adjust to the viewport. As for your following question, yes, you should Flexbox or Grid if you want to position elements responsively.
Marked as helpful1
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