8
Wasted 2 days on a CSS layout until I found flexbox gap
I was trying to space out some buttons in a row using margins and kept getting weird wrapping on smaller screens. Tried padding, even used extra divs as spacers. Then I read about the gap property for flexbox and it just worked on the first try. Has anyone else fought with margins for hours before finding a simpler CSS trick that saved you?
2 comments
Log in to join the discussion
Log In2 Comments
laurar383d ago
Flexbox gap is a total lifesaver, right? I can't believe I used to stack margins and extra wrappers for years like some kind of spacer farm. Wasted so much time debugging weird overflow issues on mobile. Honestly, it's the little CSS tricks that nobody tells you about that make the biggest difference. Grid gap is just as nice when you need it, too.
5
wilson.claire3d ago
3 years ago I was the dummy arguing that margins were fine and flexbox gap was unnecessary. I officially take it all back now.
4