Skip to content
Submitted about 3 years ago

Card component css absolute positioning of card image

bem
LVL 3
@kowsirahmed
A solution to the NFT preview card component challenge

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.

Code
Loading...

Please log in to post a comment

Log in

Community feedback

No feedback yet. Be the first to give feedback on Md Kowsir Ahmed’s solution.

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