Card component css absolute positioning of card image
Design comparison
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.
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
- @MahdiAljazairiPosted almost 2 years ago
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 helpful0@kowsirahmedPosted almost 2 years ago@MahdiAljazairi Thanks for feedback. I mentioned those solutions in my projects readme though. Github Source
0@MahdiAljazairiPosted almost 2 years ago@kowsirahmed
Well, didn't see that π
0
Please log in to post a comment
Log in with GitHubJoin 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