Design comparison
SolutionDesign
Solution retrospective
I couldn't put the eye on the image . I tried a loooot of ways but without sucess. can anyone give me a tip for this? And please give a general feedback, what i can change, add, remove. Thanks!
Community feedback
- @ywsolimanPosted about 2 years ago
Hey @yuuricrz, I hope you're doing great!
Here's how to do the image hover part using
position
:- HTML:
<div class="image"> <img class="img" src="images/image-equilibrium.jpg" alt="Equilibrium Image" /> <div class="image-overlay"> <img src="images/icon-view.svg" alt="Eye Icon" /> </div> </div>
- CSS:
main .image { position: relative; } main .image .img { display: block; max-width: 100%; } main .image .image-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 255, 247, 0.3); display: flex; justify-content: center; align-items: center; transition-duration: 0.5s; cursor: pointer; opacity: 0; } main .image .image-overlay:hover { opacity: 1; }
I hope this was helpful. Here's my solution if you want to take a look: https://www.frontendmentor.io/solutions/nft-card-using-css-flexbox-WCOwgj9t9d
Keep up the great work!👏
Marked as helpful0
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