Design comparison
Community feedback
- @dtp27Posted over 2 years ago
Hi Hammad!
Pretty good solution overall! Flexbox makes it super easy to center the NFT component on the page. You would to add something like this to your body:
body { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; }
That will center the direct child elements on the page, which in this case is just
main
(your component).Let me know if you have any questions about this, thanks!
Dan
Marked as helpful0@HammadEngrPosted over 2 years ago@dtp27 Hi Dan
First of all thank you so much for your valuable suggestion.
No doubt "flexbox" is powerful tool but I didn't use it in this because I was facing problem in aligning the "attribution div" which I created outside the "main div".
flexbox was taking both of them, and justifying both as a group, which is resulting in a side by side display.
1@dtp27Posted over 2 years ago@HammadEngr Yup great point! I just modified my body code above, because I left out one important property:
flex-direction: column;
will layout themain
andattribution
elements in a column instead of a row.Marked as helpful0
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