Nft preview card using pure HTML and CSS
Design comparison
Solution retrospective
Where I find more difficult is centering the whole NFT box in the @media screen page
Community feedback
- @Tolux001Posted over 1 year ago
Hello Joseph.
Congrats successfully completing this challenge! 🤝
There are other recommendations I can assist you with regarding centering the whole NFT DIV and regarding your code.
I want to break down the easiest way of making your layout stand out without using absolute positioning. We don't need to use absolute to center the component both horizontally & vertically. Because using absolute will not dynamical centers our component at all states To properly center the component in the page, you should use Flexbox or Grid layout.
For this demonstration we use css Grid to center the component
body { min-height: 100vh; display: grid; place-items: center; }
You can also read more on centering a div ----> https://moderncss.dev/resource-the-complete-guide-to-centering-in-css/
Now your component has been properly centered.
I hope you find this helpful 😄 Above all, the solution you submitted is great !
Happy coding!
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