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

P

@Risclover

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


This one was fairly simple for me! In fact, I was able to complete it in well under an hour, and I'm mad proud of myself for honing my HTML and CSS skills that far.

Any feedback you can provide would be nice. I did have a bit of trouble with the hover effect over the image, so any cleaner solutions would be greatly appreciated!

Community feedback

Amon 2,560

@A-amon

Posted

Hello! Great job for this. It looks very responsive too~ 😀

  • Maybe try using before/ after pseudo-elements for the eye icon 👁.

  • Also, not every image needs alt value. Depending on the use cases, it can be left as such alt="". Refer here. For example, the eye icon's alt can be leave empty. And maybe even the clock icon. 😉

1

P

@Risclover

Posted

@A-amon Hi! Thank you very much for the feedback.

I've never really used before/after pseudo-elements. I know what they are, but for some reason, I've never really learned how to use them. If you have the time, would you mind explaining to me how using that strategy works for the icon hover?

1
Amon 2,560

@A-amon

Posted

@Risclover Hello, here is the code for the eye icon using pseudo-element 😀:

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Show eye icon when .heroimg is hovered on
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
.heroimg:hover::after {
    content: "";
    height: 3rem;
    width: 3rem;
    display: block;
    background-image: url("images/icon-view.svg");
    background-size: contain;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
}

I usually use pseudo-elements for small decorative images like icons or for overlays 💭. Refer here to know about how screen readers treat them

1
Suleman 750

@legion40216

Posted

Well done...

0

P

@Risclover

Posted

@legion40216 Thank you 😄

1

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