Design comparison
SolutionDesign
Community feedback
- @correlucasPosted about 2 years ago
πΎHello Priyanshu, congratulations for your new solution!
Its better you align this component using
flexbox
than margins because it gives you more control. See the changes I did to your code below:Here's the code for the alignment:
body { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
Remove the margins and paddings:
.container { /* margin: auto; */ /* margin-top: 200px; */ padding: 20px; width: 350px; border-radius: 10px; position: relative; }
π I hope this helps you and happy coding!
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