A suggestion regarding your code that could be of interest to you to get the hover effect on the image to work:
First of all, we need to have an element that will overlay the image element.
- To do this you may need to create a div element inside the the image container that contains the icon
<div class="nftimagecontainer">
<img
class="nftimage"
src="images/image-equilibrium.jpg"
alt="Equilibrium"
/>
<div class="imageOverlay">
<img src="/*location of the icon*/"/>
</div>
</div>
Second, we need to make the newly created div be located in the same position as the image and give it the (light blue) color.
- To do this, you need to give the new div a position of absolute and its image container a position of relative so that the new div can be put anywhere in the image container
.nftImageContainer{
position:relative;
}
.imageOverlay{
position:absolute;
background-color:/*the color you want (use rgba or hsla to give the color a little opacity e.g (rgba (0, 255, 247,0.6)*/
/*styles to make the div in the same position as the image*/
left: 0;
top: 0;
width: 100%;
height: 100%;
/*this is to give the div the same border radius as the image (to make it look the same */
border-radius: /*Same border radius as the image*/;
}
/*this should also be done to position the icon in the middle*/
.icon-view{
/*the absolute value should also be put on the icon too*/
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
/*then make the overlay disappear by adding this style to the imageOverlay styles*/
.imageOverlay{
.....
......(other styles written previously)
display:none;
}
Lastly make the imageOverlay element show when the image has been hovered over
.nftImageContainer:hover .imgOverlay{
display: block;
}