@BasharKhdr1992
Posted
Your solution is great. However, regarding the hover effect, you can improve it using the follwing steps:
-
Set the position of the image as relative.
-
Set the position of the overlay as absolute.
-
The overlay element should take the whole width and height of the the overlaid element. This achieved by the following:
.nft-img-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; height: 100%; width: 100%; border-radius: 12px; background-color: hsl(178, 100%, 50%); opacity: 0; transition: opacity 0.5s; }
-
And finally for centering the eye icon inside the overly I used the following:
.nft-icon-view { position: absolute; opacity: 0; top: 42.5%; left: 42.5%; }
4.1. I used positioning with the icon because I did not want the opacity of the overlay to affect the eye as well. For more information on overlaying visit the following link: Image overly icon
Marked as helpful
@IsNeonPlay
Posted
@BasharKhdr1992 I really appreciate it too much, I hadn't thought about that at the time of making the code, for a similar test I'll try to apply it. Thank you!