Design comparison
SolutionDesign
Solution retrospective
Hi, just wanted to ask if there is any better way to center a div horizontal and vertical on a page and i also want be able to increase in size when i add more content to div. Thanks
Community feedback
- @claudionettoPosted about 1 year ago
There are other ways to center a div, but the easiest and most recommended for this solution and for most as well is to use flexbox, just as you did in this challenge. As for your second question, your div is already following the size of its children vertically, so if you add more text, it will grow normally, following the defined properties.
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