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 card made with React using Styled Components

@aaronsts

Desktop design screenshot for the NFT preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Really enjoyed this little project, just have a question. The way I do my hover effect on the image, is there a easier/better way to do it? Right now I made it as a background-image for a div instead of an image tag

Thanks! :)

Community feedback

P
Q-bert 210

@QBERT18

Posted

You can do it like me with the :after sudo element. Sudo Element don't works on the img tag selfe. You have to do it on the parent element don't forget to give the parent element position:relative. If you don't know why just google about positioning in css :) I hope i could help you.

.card-header:after { content: ""; position: absolute; width: 100%; height: 100%; top: 0; left: 0; background-color: any color you want; opacity: 0; border-radius: 10px; /setting the eye icon the center after you hover it/ background-image: url("./images/icon-view.svg"); background-repeat: no-repeat; background-position: center; } .card-header:hover:after { opacity: 0.8; /* to make it transparent / transition: 500ms all; / little bit of animation / cursor: pointer; / turn the standard cursor to an finger pointing */ }

Marked as helpful

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