T
9

The 3am spacer trick that fixed my button layout

Last month I was fighting with a form for hours. Buttons were cramped, text overlapping, looked terrible. I kept messing with margins and padding, nothing clicked. Then I remembered a tip from a YouTube video about using spacer elements instead. Simple divs with fixed heights, nothing fancy. Put a 16px spacer between the buttons and a 24px one above the submit. Took me 5 minutes to swap it out. Everything just fell into place. Is that a normal crutch for beginners, or do people actually plan spacing that way from the start?
1 comments

Log in to join the discussion

Log In
1 Comment
schmidt.blake
schmidt.blake1mo agoTop Commenter
Spacers are like training wheels, most devs end up using margin utilities or gap once they get comfortable, but the spacer trick makes the structure obvious when you're still learning. It's actually not a bad habit to keep around since it forces you to think about the spacing as part of the layout, not an afterthought.
8