Tailwind CSS is the styling framework that almost every modern web project uses in 2026 — Next.js, React, Vue, Svelte, Astro. If you're building for the web, you'll encounter it. Here's the fast version: what it is, why it took over, and how to start using it today.
What Tailwind CSS is
Tailwind is a utility-first CSS framework. Instead of writing custom CSS classes like.card-header, you compose styles directly on elements using small, single-purpose classes: text-lg font-bold p-4 bg-white rounded-xl shadow-md.
Each class maps to exactly one CSS property. text-lg = font-size. font-bold= font-weight. p-4 = padding. bg-white = background-color. You learn them by using them, and the documentation is excellent.
Why Tailwind won
Three reasons, in order of importance:
- No naming problem. Traditional CSS forces you to invent class names for everything. Tailwind eliminates that decision entirely — you never name a class again.
- Co-location. The styles live on the element, not in a separate file. You see the layout and the styling in the same place. Refactoring is safer because deleting a component deletes its styles too.
- AI compatibility. LLMs generate Tailwind classes more reliably than arbitrary CSS because the naming is systematic. This made Tailwind the default for every AI app builder in 2025–2026.
The core concepts (10-minute version)
Spacing
p- for padding, m- for margin. Number = the scale (4 = 1rem, 8 = 2rem). Add a direction: px- horizontal, py- vertical, pt- top,mb- bottom.
Typography
text-sm, text-base, text-lg, text-xl throughtext-9xl for size. font-normal, font-medium,font-semibold, font-bold for weight. text-gray-600 for color.
Layout
flex and grid do what they say. flex items-center justify-between= horizontal layout, vertically centered, pushed to edges. grid grid-cols-3 gap-4 = three-column grid with gutters.
Responsive
Prefix any class with a breakpoint: md:text-xl means "text-xl at medium screens and above". Mobile-first: unprefixed = mobile. sm:, md:, lg:,xl: for larger viewports.
Colors
bg- for background, text- for text, border- for borders. Colors follow a scale: gray-50 (lightest) to gray-950 (darkest). Every color has 50–950 shades.
Getting started
If you're using an AI app builder like InBuild, Tailwind is already configured. The generated code uses Tailwind classes, and you edit them visually or by typing class names directly.
If you're setting up a new Next.js project manually, Tailwind comes pre-configured withcreate-next-app. For existing projects, install tailwindcss and@tailwindcss/postcss — the docs walk through it in under five minutes.
Five patterns you'll use constantly
flex items-center gap-4— horizontal row of items with spacingmax-w-7xl mx-auto px-6— centered, width-capped content containerrounded-xl border border-gray-200 p-6 shadow-sm— clean cardtext-sm text-gray-500— muted secondary texthover:shadow-lg hover:-translate-y-0.5 transition-all— subtle hover lift
Next steps
Open tailwindcss.com/docs and keep it open while you work — it's the best CSS reference on the web, period. Search for any CSS property and you'll find the Tailwind equivalent with examples.