Design comparison
Solution retrospective
Can someone help me with adding the overlay in the image and adding the eye icon in the image, any suggestion is always welcome. Thank You..
Community feedback
- @mamba-dev-KEPosted over 2 years ago
Hey, good job on this. The easiest way for me is using pseudo-elements i.e. ::after. I will share a code pen to an example.
0 - @jibreel1Posted over 2 years ago
Nice design here, prince.
For the eye icon overlay in the image, you can add a pseudo element on the image, the equilibrium image (::after or ::before). After that, set the opacity of the eye icon to zero(0). Then, in the hover of the pseudo element (the eye icon), set the the opacity to one(1). With these, when you hover on the image, the eye icon will display.
.icon{ background-image: the equilibrium image; } .icon::after{ background-image: the eye icon; opacity: 0; }
.icon: hover ::after{ opacity: 1; }
Read more on pseudo elements to get a clearer understanding of this explanation. Is it well understood??
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