Skip to main content

2 posts tagged with "buttons"

View All Tags

I Only Added w-full, Why Is My Button Text Centered? Understanding Browser Defaults

· 11 min read
Mahmut Salman
Software Developer

I'm learning frontend development, and something weird just happened. I added only w-full to my button, and the text "Click me" became centered horizontally! 🤔 I didn't add any text-centering classes. My frontend mentor revealed something I never knew: browsers have default styles that help us without us even knowing. This conversation opened my eyes to the invisible CSS working behind the scenes.

Wait, My Buttons Are Still Side-by-Side Without Flex? Understanding inline-block vs Flexbox

· 13 min read
Mahmut Salman
Software Developer

I removed flex from my button container, expecting them to stack vertically, but they're still sitting side-by-side! 🤨 I thought flex was what made them horizontal. My frontend mentor corrected my misunderstanding: buttons are inline-block by default, which means they naturally sit beside each other. This conversation taught me the crucial difference between "happens to be side-by-side" and "controlled side-by-side layout."