Design comparison
Solution retrospective
I'm having trouble keeping the view icon opacity at 1 and the background opacity at 0.5 while I hover over the image, if anyone knows how to do that plaese leave a comment
Community feedback
- @amalkarimPosted almost 2 years ago
Hi Nicolas,
To achieve what you want, we can give
opacity: 1;
to.image .overlay:hover
, i.e. when it's hovered by user, and give its background's opacity less than 1 from the very start. Changebackground-color: var(--cyan);
tobackground-color: hsla(178, 100%, 50%, 0.5);
for.image .overlay
. Or you could create another variable for storing the color.hsla()
is a more flexible color code thanhsl()
where we can set the opacity to other than 1.Hope this helps. Happy coding!
1
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