TwTailwind CSS · Lesson 2 of 8
Spacing & Sizing
Tailwind's spacing scale is based on `0.25rem` increments. `p-4` = 1rem padding, `m-8` = 2rem margin, `w-1/2` = 50% width. Memorize the scale and you stop looking things up.
✦ Tip
The most useful size to memorize: `p-4` = `padding: 1rem` (16px). Everything else is a multiple: `p-2` = 0.5rem, `p-8` = 2rem, `p-16` = 4rem. The scale is consistent across padding, margin, width, height, gap, and border-radius.
The most useful size to memorize: `p-4` = `padding: 1rem` (16px). Everything else is a multiple: `p-2` = 0.5rem, `p-8` = 2rem, `p-16` = 4rem. The scale is consistent across padding, margin, width, height, gap, and border-radius.