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 card with hover effect

Tarunaβ€’ 305

@Tiyana19

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


Please Give your feedback and let me know where I can improve myself.

Community feedback

visualdennisβ€’ 8,255

@visualdenniss

Posted

Hello Tinker :)

Nice job completing the challenge successfully! Suggestions:

  • It looks like the span texts are broken into two lines, but in the design they are all in the same line. A quick fix would be using this: white-space: nowrap; for .num-class .eth, .days (i showed this example to make you aware of this property)

but there is even a better way, just use align-items: center;

  • .num-class .eth, .days { display: flex; align-items: center; }

Why better than white-space in this case? Cuz if you notice, while it solves line break, the icons seem to be stretched in height a bit, this is because flexbox by default stretches it. align-items: center; not only fixes the line break but also fixes the stretching of the icons.

And no, adding gap: 5px as suggested, won't fix it because that is not the issue.

  • Bonus TIP: You can add a transition like transition: all .4s ease; to .equil-img make the overlay appear smoothly.

Hope you find this feedback helpful!

Marked as helpful

1

Tarunaβ€’ 305

@Tiyana19

Posted

@visualdenniss Thank you so much for your suggestion.

just want to ask you if I had used that property white-space, than what tag I had to use to wrap that icons?

I have updated my solution with align-items: center.

0
visualdennisβ€’ 8,255

@visualdenniss

Posted

@Tiyana19 On .num-class .eth, .days

You can play around with the examples here to see what effect it does with which value: https://developer.mozilla.org/en-US/docs/Web/CSS/white-space

Marked as helpful

1
Abdul Khalid πŸš€β€’ 72,180

@0xabdulkhalid

Posted

Hello there πŸ‘‹. Congratulations on successfully completing the challenge! πŸŽ‰

  • I have other recommendations regarding your code that I believe will be of great interest to you.

CSS 🎨:

  • Looks like the component needs a bit of padding so add some padding to the main element.
  • And, the items inside .eth & .days are need to placed side by side but here they are stacked upon each other. We can fix it by following snippet.
.eth, .days {
    display: flex;
    gap: 5px;
}

.

I hope you find this helpful πŸ˜„ Above all, the solution you submitted is great !

Happy coding!

Marked as helpful

1

Tarunaβ€’ 305

@Tiyana19

Posted

@0xAbdulKhalid Thank you so much for your recommendations

I have added the gap: 5px property,

but I have doubt that I used the margin-left property on the icons , and it works the same as gap then what's the difference between them?

0
Tarunaβ€’ 305

@Tiyana19

Posted

@0xAbdulKhalid Thanks a lot

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