Skip to main content

5 posts tagged with "flexbox"

View All Tags

How Does This Badge Work? Understanding CSS Class Order and the relative-absolute Pattern

· 13 min read
Mahmut Salman
Software Developer

I copied the classes for a notification badge and it worked perfectly, but I had no idea what was happening! 🤔 The classes were all jumbled: absolute -top-2 -right-2 bg-red-500 text-white... My mentor reorganized them in logical order, and suddenly everything clicked. Then I made a brilliant connection: relative + absolute is like max-w + mx-auto—they're paired concepts that work together! This conversation taught me to see the patterns behind CSS.

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."

Why Adding 'block' to My Label Changed Everything: Understanding CSS Display Property

· 11 min read
Mahmut Salman
Software Developer

I'm learning frontend after years of backend work, and I just discovered something fundamental that nobody explains clearly: the display property. I added block to my label, and suddenly my form inputs stacked vertically instead of sitting side-by-side. I had no idea what I just did. 🤯 My frontend mentor explained how block, inline, and inline-block are the foundation that flexbox and grid are built on. This conversation changed everything.

Why My Password Field Wasn't Spacing Correctly: Understanding Form Structure and space-y

· 13 min read
Mahmut Salman
Software Developer

I'm a backend developer building my first login form, and I couldn't figure out why my password field wasn't spacing away from the email field. Both fields were squished together even though I had space-y-4 on the form! 😤 My frontend mentor showed me a critical structural mistake: I put both fields in the SAME div. This conversation taught me why form structure matters just as much as styling.

The Mystery of CSS Flexbox Centering: Why Merging Two Divs Breaks Everything

· 10 min read
Mahmut Salman
Software Developer

I'm a backend developer learning frontend, and I just spent 2 hours debugging why my centered login form moved to the left when I "simplified" my code. The CSS felt like black magic. 🎩✨ My frontend mentor showed me why two divs are NOT just redundant nesting—they're a fundamental pattern in CSS positioning. Let me share this conversation that changed how I think about layout.