Skip to main content

One post tagged with "box-model"

View All Tags

Wait, Why Does My Width Stay 384px But Height Changes? Understanding the CSS Box Model

· 9 min read
Mahmut Salman
Software Developer

I'm a backend developer learning frontend, and I just noticed something weird in Firefox Inspector. I removed p-8 from my div, and the height changed from 124px to 60px—but the width stayed at 384px! 🤔 My frontend mentor explained the CSS Box Model and why w-96 behaves differently from h-auto. This conversation finally made the box model click for me.