Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

nft-preview-card using HTML and CSS

@HammadEngr

Desktop design screenshot for the NFT preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

Dan 300

@dtp27

Posted

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 helpful

0

@HammadEngr

Posted

@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
Dan 300

@dtp27

Posted

@HammadEngr Yup great point! I just modified my body code above, because I left out one important property: flex-direction: column; will layout the main and attribution elements in a column instead of a row.

Marked as helpful

0

@HammadEngr

Posted

Thanks Dan! I have learned it

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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