Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

NFT preview card component

@ujwalvinay

Desktop design screenshot for the NFT preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


How to make the eye icon visible while hovering over the image? How to make it responsive for smaller devices?

Community feedback

Byron 2,180

@byronbyron

Posted

Hi @ujwalvinay

You can put the overlay hover on the image by adding an image wrapper and using a pseudo element, something like:

<div class="img-wrapper">
    <img src="images/image-equilibrium.jpg" alt="image" id="banner">
</div>
.img-wrapper {
    position: relative;
}

.img-wrapper::before {
    content: '';
    background: url('../images/icon-view.svg') center no-repeat hsla(178, 100%, 50%, 0.5);
    display: block;
    border-radius: 1.2rem;
    position: absolute;
    top: 0;
    right: 5%;
    bottom: 0;
    left: 5%;
    z-index: 100;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
}

.img-wrapper:hover::before {
    visibility: visible;
    opacity: 1;
}

Hope that helps! 👍

Marked as helpful

2

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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