Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 3 years ago

NFT Preview Card Component with hover effects

The Requiem•330
@TheRequiem
A solution to the NFT preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


The only thing that bothered me most was the transparent hover effect. Though I used position: relative and position absolute to overlap. The top value was not responding to the anchor point but viewport which was extremely troublesome because changing the height or width of the viewport would move around the overlay and stop it from overlapping. Setting the width of it to the width of the image would work nicely with a huge caveat that the SVG icon would scale to the width and overlap the whole screen with the huge eye of Sauron. I ended up using a combination of padding and margin to make it work but it doesn't feel like the ideal solution. Another thing that I am unsure of is the line, I used the <hr> tag and my line is thicker than it should be because making it any smaller was splitting it in 2. Any feedback regarding both is definitely welcome and I would love any feedback regarding making my code better with better practices. Thanks for your time!

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 The Requiem'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

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

Frontend Mentor

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

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