You can do it like me with the :after sudo element. Sudo Element don't works on the img tag selfe. You have to do it on the parent element don't forget to give the parent element position:relative. If you don't know why just google about positioning in css :) I hope i could help you.
.card-header:after { content: ""; position: absolute; width: 100%; height: 100%; top: 0; left: 0; background-color: any color you want; opacity: 0; border-radius: 10px; /setting the eye icon the center after you hover it/ background-image: url("./images/icon-view.svg"); background-repeat: no-repeat; background-position: center; } .card-header:hover:after { opacity: 0.8; /* to make it transparent / transition: 500ms all; / little bit of animation / cursor: pointer; / turn the standard cursor to an finger pointing */ }
Marked as helpful