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 Page using HTML and CSS

@yuuricrz

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


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

@ywsoliman

Posted

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 helpful

0

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