Width
| Class | Width |
|---|---|
w-64 |
16rem |
w-1/2, w-1/3, w-3/4 |
fractions of the parent |
w-full |
100% |
w-screen |
100vw |
w-auto, w-fit |
auto / fit content |
Height
h-12, h-full, h-screen, min-h-screen (at least the full screen height — common for page layouts), h-dvh (mobile-friendly full height).
Both at once
size-10 sets width and height — perfect for icons and avatars.
Max width
Keep text readable and layouts centred:
max-w-sm, max-w-md, max-w-xl, max-w-4xl, max-w-7xl, max-w-prose
<main class="max-w-5xl mx-auto px-4">
This is the most common page wrapper in Tailwind.
Example
Example — Sizing utilities
HTML
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<div class="p-6 space-y-3">
<div class="w-full bg-rose-200 p-2">w-full</div>
<div class="w-1/2 bg-rose-300 p-2">w-1/2</div>
<div class="w-1/3 bg-rose-400 p-2">w-1/3</div>
<div class="w-64 bg-rose-500 text-white p-2">w-64 (16rem)</div>
<div class="flex gap-3 items-center">
<div class="size-8 bg-indigo-500 rounded-full"></div>
<div class="size-12 bg-indigo-500 rounded-full"></div>
<div class="size-16 bg-indigo-500 rounded-full"></div>
</div>
<p class="max-w-md bg-slate-100 p-3 rounded">max-w-md keeps this paragraph from becoming too wide on large screens, which makes it easier to read.</p>
</div>