Design comparison
SolutionDesign
Solution retrospective
I could not figure out how to code the active state for the image. How do you make those styles?
Community feedback
- @dusan-bPosted about 2 years ago
Hi VMH1225,
To get the hover effect, you should wrap the image like this:
<a class="overlay" href="#"> <img class="mainImage" src="images/image-equilibrium.jpg" alt="Equilibrium"> </a>
And then add the following CSS rules:
main { isolation: isolate; } .overlay:hover { background: linear-gradient( hsla(178, 100%, 50%, 0.5), hsla(178, 100%, 50%, 0.5)), url(images/icon-view.svg) center no-repeat; border-radius: 2%; } .mainImage { position: relative; z-index: -1; vertical-align: top; }
If something is not clear, feel free to ask. Keep it up, and happy coding. :)
Marked as helpful1
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