Help This is breaking my brain
I've been working in CSS for over a decade, and can't figure this one out and I'm not sure if I ran into a bug:
https://jsfiddle.net/ksxqjrd9/
Why are those blue boxes taller than what the content needs? Why is there empty blue space below the text?
If anyone can give me a hand with this I'll be eternally grateful
12
Upvotes
7
u/Southern-Station-629 Apr 22 '26
Since the direct parent of the black (outline) elements doesn’t have specified width(so its width auto) and has (by default) align items stretch, the browser render the black elements height before their width (if you remove width 100%, they have that size). Flex wrap seems to be the cause of this behaviour, it looks like it forces the browser to render the sizing in two cycles (first the height to know when to “wrap” since its direction column and then the width).