Design comparison
SolutionDesign
Solution retrospective
I cann't get the view icon to show went hovering over the img??
Community feedback
- @ShiironPosted almost 3 years ago
Hi !
to change the color and to display the icon on hover for the image, the easiest way (for me) is to create an overlay with an opacity of 0 and using :hover to set it up as 1 (you can also add transition for a smooth effect)
<div class="card-image"> <img src="{yourImage}"> <div class="card-image-overlay center"> <img class="card-view-icon" src="{yourIcon}"> </div> </div>the "card-image" div is in position relative and the "card-image-overlay" is on absolute. From there you can customize and style it.
I hope it helps !
Marked as helpful2
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