Design comparison
Solution retrospective
I separated the illustration hero image from the rest of the card because I found this worked better for me. However, I noticed a small gap between the two which wasn't caused by any margin, and I inspected each element to make sure.
Is there an explanation for this? Does the <header>
tag I wrapped the image in leave a space below it and the next block-level element?
I found a workaround, but I'm curious what others have to say about this.
Community feedback
- @FluffyKasPosted about 3 years ago
Hiya, you can get rid of the small gap if you set
display: block
on your image. If you're curious about why this is happening, watch this awesome video: (https://www.youtube.com/watch?v=plOl7TNc89A&t=2s)Marked as helpful1 - @mathieu-superposePosted about 3 years ago
I have no proper explanation, since the height of the header should be defined by the image it contains, but using display:flex makes rid of it.
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