r/csshelp • u/stoxnbonds • Aug 08 '20
This gap is driving me crazy!
I have cards that I'm placing in a grid layout. Each card is actually a column flexbox with an image on top and a h3 on bottom. The image is a fixed size. Each card should only take the size of its children.
Using chrome devtools, I can see there is a gap between the h3 and its padding and the image above, but I can't tell what its from and I can't get rid of it. I also checked another browser and its the same.
https://codepen.io/jstocks/pen/JjXdjbw
I'm quite new to CSS. If there is a better place to ask this, let me know please.
9
Upvotes
3
u/RedDragonWebDesign Aug 08 '20
I was surprised when I went into your CodePen and I didn't see flex used on the card. That is the approach I would take.
Here's a JS Fiddle with the gap fixed.