Wait, I Only See h-48 for Height—Where's the Width? Understanding How CSS Grid Automatically Sizes Cards
· 14 min read
I built my responsive grid with grid-cols-1 sm:grid-cols-2 md:grid-cols-3, and I see h-48 controlling the image height, but where's the width? 🤔 There's no w-48 or w-64 on my cards! How do they know how wide to be? My mentor dropped a knowledge bomb: "The grid controls width automatically—you don't set it!" This blew my mind. The grid is the boss, and cards just obey. Understanding this changed how I think about responsive layouts! 📐✨
