Design comparison
SolutionDesign
Solution retrospective
What i found difficult was create the hover effect on the NFT image. Only that, if someone has a solution, please leave a comment!
Community feedback
- @freaky4wrldPosted about 1 year ago
Hey there, here's what you can do to achieve the hover effect on your image......
- first of all I would recommend you to wrap your image in a div, there's no harm in that.....
- then create a new div that's going to give you the hover effect, give it similar width and height styling just like the nft-img
- then you can add a background color to the newly created div, particularly using an rgba value and a background-image view-icon(eye-svg) and having a z-index of negative value
.img-overlay:{ background-image: url(eye-icon.svg); background-color: rgba-value; width: [similar to nft-img]; height: [similar to nft-img]; z-index: -1; }
- give your nft-img a z-index of zero
#nft-img{ z-index: 0 }
- on hover over the parent-element of the image and the overlay...... you can increase the z-index of the overlay, i.e.
.img-overlay:hover{ z-index: [value greater than #nft-img] ; }
I hope this works, I would recommend you to look for z-index CSS property......glad to help you :)
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