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

Vanilla CSS/Minimal Code NFT Card

@ChrisAndrewsDev

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


Hey guys!

Had some fun on this one, got to play around with the transform/scaling properties, as well as some pseudo classes.

Are there any opportunities to reduce my code down in this solution?

Any feedback would be much appreciated! ^.^

Community feedback

Prantik 660

@prantiknoor

Posted

Hey @ChrisAndrewsDev 🙂. You nicely solved this problem. Congrats 🎉🎉

You used top: 42%; translateY(-43%); to position the .icon-container above the image. You do not need this. You can easily do that by using top: 0. Because '.icon-container's position is relative to .image-containeras you usedposition: relativein.image-container`;

.image-container {
    position: relative;
}

.icon-container {
    opacity: 0;
    position: absolute;

    /* top: 42%;
    translateY(-43%); */

    top: 0;

    height: 100%;
    width: 100%;
    background-color: var(--cyan);
    border-radius: 10px;
    transition: all .4s ease;
}

Marked as helpful

1

@ChrisAndrewsDev

Posted

@prantiknoor Thanks for the advice, that worked great! I was having issues with that part, so it's much appreciated ^.^

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