Skip to main content

2 posts tagged with "positioning"

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.

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.