Design comparison
SolutionDesign
Solution retrospective
I have challenges with the styling of the image overlay effect. I would be glad if someone could help enlighten me more on this.. Thanks
Community feedback
- @elaineleungPosted over 2 years ago
Hi Spaceship Tech, I think you did a great job here, and the overlay is working well 🙂
I just checked out your code and saw that you used
position: absolute
in positioning the eye icon. What I did instead was, since the icon is within the overlay container, I just useddisplay: grid
to center the icon. Here's what my overlay looked like:.overlay { position: absolute; width: 100%; height: 100%; top: 0; left: 0; z-index: 1; background-color: hsla(178deg, 100%, 50%, 0.5); opacity: 0; display: grid; place-content: center; transition: opacity 200ms ease-in-out; } .overlay img { width: 3rem; height: 2rem; } .overlay:hover { opacity: 1; }
Hope this gives you some ideas on what you can try next time!
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