T
17

Tried grid for a hero layout and it beat flexbox hard

I spent 2 hours wrestling a hero section with flexbox and media queries, then swapped to CSS grid in 15 minutes flat. The way grid handles both the text overlay and the background image alignment without extra wrappers was just better. Anyone else find themselves picking the wrong tool for layout basics?
2 comments

Log in to join the discussion

Log In
2 Comments
the_gray
the_gray6d ago
wait what, 2 hours? i mean i get it flexbox can be a pain sometimes but two hours on a hero section feels like you were fighting it on purpose lol. grid is definitely the cheat code for that kind of overlay stuff though, once you get used to it it's hard to go back.
5
nathanking
Misreading what he said though, flexbox was fine it was just the z-index stacking.
5