NFT Preview Card using Flex and interactive hover/active conditions
Design comparison
Solution retrospective
I used a similar technique from W3Schools to change the main image on hover and on active (click): https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_image_overlay_opacity
Are there any other/better ways?
Community feedback
- @SamHemingwayPosted over 2 years ago
I love how well maintained and commented your CSS is Marc, great stuff!
One thing I noticed: the teal overlay on the image appears to actually become visible on click as opposed to on hover.
It took more time than I expected to figure out how to make this work when I started this challenge. In the end, I went with using
:before
and:after
pseudo-classes to pull it off rather than putting the "Eye" image into the DOM itself.Check out the useful resources from my readme if you'd like to try figuring out how to do this yourself. And then, if you're struggling, you can see how I implemented it in my code.
Keep up the great work!
1@MarcHowePosted over 2 years agoThanks @SamHemingway!
I had read in the brief that the teal colours and image overlay should appear on active, so I made them all appear when you actually click on the links/image - it was only after I updated the readme I noticed it should be on hover so I'll need to fix that :)
I'll check out those resources in your readme, thanks so much for taking the time to review and provide some great suggestions!
0
Please log in to post a comment
Log in with GitHubJoin 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