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

Wasim 90

@WasimAkramS

Desktop design screenshot for the NFT preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

@UnTalPeluca

Posted

Your solution is really good. I notice than when hover the image you can notice that it has an empty space at the bottom, you can fix it by adding

display:block

to the product image.

Keep up the good work, you'll do very well. You can contact me on discord if you need any help Peluca#7132

Marked as helpful

1

Wasim 90

@WasimAkramS

Posted

Hi@UnTalPeluca That extra space problem got fixed really, as you said. Please explain the logic behind this. Initially I tried on this but I could not. But you exactly pointed out the solution. Please teach me.

0

@UnTalPeluca

Posted

@WasimAkramS I understand that this happens because img, being an inline element, is rendered as if it were text, and the text has a space below it for certain letters such as "g", "j". You can check it by giving the property "font-size: 0" or "line-height:0" to the image container, I prefer to use "display:block" in the images because it is what makes the most sense to me, we want the image behaves like a block. Always in my projects at the top of my css I write

img {
    display: block;
}

Marked as helpful

1
Wasim 90

@WasimAkramS

Posted

@UnTalPeluca Thank u. It is really helpful to me.

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