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

Card component css absolute positioning of card image

Md Kowsir Ahmedβ€’ 250

@kowsirahmed

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 faced a problem while absolute positioning the overlay above the ethereum(card main image). It shows some empty space at the bottom of the image.

Image showing faced problem

This is solved when I thought about the spacing for element(e.g. CSS box model). From inspection I made sure there is no margin or padding creating the problem. Then I thought about the content size in the box model. I knew text content takes an height equal to the line height for each line. As images are inline elements, it was following the rule for text contents of line-height. So, I just removed the line height in it's container.

Community feedback

Mahdi Aljaza'iriβ€’ 250

@MahdiAljazairi

Posted

Hi there! I guess there is a simpler solution to the problem you have mentioned. Just make images into block elements! This also avoids issues you might have if the container had actual text as well as images.

Besides that.. Good job you did πŸ‘

Marked as helpful

0

Md Kowsir Ahmedβ€’ 250

@kowsirahmed

Posted

@MahdiAljazairi Thanks for feedback. I mentioned those solutions in my projects readme though. Github Source

0
Mahdi Aljaza'iriβ€’ 250

@MahdiAljazairi

Posted

@kowsirahmed

Well, didn't see that πŸ˜…

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