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

NFT-Preview-Card-Component

react, styled-components
Victor Fedorov•20
@Cor4zon
A solution to the NFT preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Hi, friends! Hope for your feedback❤️

What did you find difficult while building the project? I tackled a problem with hover effect. I was not sure about best way of solving it. Could anybody answer is that okey to get hover effect just by changing background-image on hover. Is there any better solution?

const CardImage = styled.div`
  width: 278px;
  height: 278px;
  margin: 0 25px;
  border-radius: 8px;
  background-image: url(${EquilibriumImg});
  background-size: cover;
  @media (min-width: 390px) {
    width: 302px;
    height: 302px;
  }
  &:hover {
    background-image: url(${EquilibriumHoverImg});
  }
`;

Which areas of your code are you unsure of?

I used a styled-components for a first time. So can anybody check it please here?

Do you have any questions about best practices?

What's the best practice of using styled-components?

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 Victor Fedorov'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