Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 2 years ago

NFT preview card component challenge on Frontend Mentor Using Html, Cs

Aaron Li•90
@aaronli722
A solution to the NFT preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I got some questions when doing the challenge:

  1. Is it a good way to use <main> as the background element? My purpose is to apply CCS flex so as to center the card.

  2. Flex gap

Does flex-gap exist? I found the property on the web but nothing happen when I applied it to my code and finally, I have to use margin.

  1. how to vertically center svg?

when I added svg (the eth icon and clock icon) to my codes, I found it is at the top-left of the box. I used flex align-items to center them. But is there another way to verically center svg?

  1. overlay color on image, is it possible(no need to add a div)?

to apply the hover effect of the main image, I added a div with overlay color. But is there any way that I no need to add a div but just do some css rules to the image?

  1. why can't the image fully fill the box?

There is a 1px gap at the bottom and I have to set the height to 99% to fix it.

  1. Is it a good way to use <main> as the background element? My purpose is to apply CCS flex so as to center the card.

  2. Flex gap

Does flex-gap exist? I found the property on the web but nothing happen when I applied it to my code and finally, I have to use margin.

  1. how to vertically center svg?

when I added svg (the eth icon and clock icon) to my codes, I found it is at the top-left of the box. I used flex align-items to center them. But is there another way to verically center svg?

  1. overlay color on image, is it possible(no need to add a div)?

to apply the hover effect of the main image, I added a div with overlay color. But is there any way that I no need to add a div but just do some css rules to the image?

  1. why can't the image fully fill the box?

There is a 1px gap at the bottom and I have to set the height to 99% to fix it.

s

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Aaron Li's solution.

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
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License