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-component-main

@Cesar-Andres-Puma

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

Travolgi 🍕 31,420

@denielden

Posted

Hi Cesar, I took some time to look at your solution and you did a great job!

Also I have some tips for improving your code:

  • add descriptive text in the alt attribute of the image
  • To make it look as close to the design as possible set width: 22rem; to container class
  • remove all margin from container class because with flex they are superfluous
  • for fix the hover effect add position: relative; to div with image class and set to inside div
top: 0;
width: 100%;
height: 100%;`

Overall you did well :)

Hope this help and happy coding!

Marked as helpful

0

@Andrew-Castro

Posted

This design works best if this card has a fixed width, in this case it's 350px. Avoid using percentages for widths as it doesn't lend itself well to responsive design (unless you're writing dozens of media queries to deal with it).

Same goes for padding and margin, you can see the desktop and mobile designs have consistent spacing, so you're not going to want to use percentages for these values. Try playing with pixels or rem units for these.

For example, the overall padding on the card is 24px on all sides, right now you're using 1.5% which is causing the padding to be a variable size based on screen width, if you set it to 24px or 1.5rem, this is be consistent with the design.

There's more that could be improved on but I will leave you with this and help further if needed, good luck!

Marked as helpful

0

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