nft preview card componen main
Design comparison
Solution retrospective
if anyone can tell me how to display the icon view on hover without removing the image behind it would be appreciated. I tried several techniques but I couldn't find it.
Community feedback
- @SatellitePeacePosted about 2 years ago
Hello @DavidMartelCloutier your NFT card looks great
-
now to answer your question
-
There is a CSS property called z-index.
-
z-index determines the overlapping contents that will appear first without affecting the position or visibility of other contents
-
If you have not tried the z-index you should try it
set the z-index of the icon to 3 then set the z-index of the image to either -1 or 1
like so
main__img:hover{ z-index: -1; } .icon__img:hover{ z-index:3; } ```` I hope this helps
Marked as helpful0@DavidMartelCloutierPosted about 2 years ago@SatellitePeace
Thanks, i try this
0@Raja-JunaidPosted about 2 years ago@DavidMartelCloutier Hi David. Congratulation on completing this challenge.
There is another way to add an eye image in your hover. So you can also add background-image: url(); and then add URL of an eye image.
.img:hover{ backgroun-image: url(); }
and then add url.
I hope this helps you
Marked as helpful1 -
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