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 Preview Card

t-rieu 20

@t-rieu

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 am not sure if the way I wrote my CSS for the SVG that overlays the image on hover is the most efficient. Any suggestions and recommendations for it are welcomed. Feedback on any other areas of my HTML and CSS codes is also highly welcomed.

Community feedback

Macdeesh 610

@macdeesh

Posted

Just a few things to add to what @mohamed-benoughidene said :

1- I would recommend wrapping the Equilibrium or the NFT image with an anchor tag. Every place you see a hover style, you need to include an interactive element, like an anchor tag or button.

2- I would do the hover effect on this using pseudo-elements like ::before or ::after rather than adding extra in the HTML. But that's not essential. Also, for the other SVG icons you can use pseudo-elements in CSS as the icons are all decorative.

Marked as helpful

1

t-rieu 20

@t-rieu

Posted

@macdeesh Noted, thanks for the advice!

0
Mohamed 270

@mohamed-benoughidene

Posted

hello t-rieu✌

-first I noticed that you used 3 identical properties witch is display in the class named overlay line 26,28,31 you can write it ones because only the last one will apply in your case display: flex;.

-for the overlay I used a different approach instead of wrapping only the svg inside a div i wrapped both the card img and the overlay div containing the svg inside one div.

-for the overlay style i didn't use display: flex; like you did instead I did this background cyan , position absolute opacity 0, z-index 99, top: 0, left: 0, on hover state just opacity 1.

  • you can check my solution for that just head to my profile. I hope you find my answer helpful if so please upvote me and mark it as helpful.

Marked as helpful

1

t-rieu 20

@t-rieu

Posted

@mohamed-benoughidene Thanks for pointing out the three identical properties, I must have overlooked them. And, thanks for letting me know how you approached the SVG and img, it is helpful!

0

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