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

Solution : NFT Preview Card Component

@Herteitr

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


I'm not sure if this is the best way to put a hover effect on the picture. I've never liked using the "position : absolute " property. If you know of another way to do this, I'd appreciate it if you could share it.

Community feedback

P

@andreasremdt

Posted

Hey @Herteitr,

Congrats on finishing this challenge, I like how close it is to the design. Also, your HTML and CSS are really clean and easy to read, nice!

To answer your question about the image: I get what you mean, I also don't like position: absolute that much. However, in these situations, it's the most straight-forward approach and works really good, generally speaking (as long as you don't forget position: relative on the parent ;))

In your solution, you used a div with the eye icon as a child, which is fine. There's a cleaner way with less HTML though, and this can be achieved by using the pseudo elements ::before or ::after.

You can check out my solution, where I've used this approach. It's quite similar to your solution but saves on the HTML markup. Let me know if you have any additional questions :)

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