# Tailwind CSS

> A CSS framework of small classes. Each one does a single styling job.

**Field:** Software Development  
**Category:** Web Development  
**Also known as:** Tailwind, TailwindCSS, Utility-First CSS

## Think of it like

Think of it like a box of Lego bricks. You build each look from small pieces, not from one big moulded toy.

## Definition

Tailwind CSS is a free CSS framework built from small utility classes. Each class does one thing. p-4 adds padding, text-center centres the text, and rounded-lg rounds the corners. You put the classes straight on the element, so you rarely write your own CSS file. A build step keeps only the classes you used, so the final file stays small.

## Example

Jack styles a button with class="px-4 py-2 rounded bg-blue-600 text-white". He never opens a CSS file.

## Example code

```html
<button class="px-4 py-2 rounded-lg bg-blue-600 text-white">
  Buy now
</button>
```

Five small classes give the button its padding, corners and colours.

## Why it matters

It is one of the most used ways to style new web apps. Many starter kits and AI tools write it by default.

## Common mistake

Thinking long class lists mean messy code. Repeated groups belong in a reusable component, not copied by hand.

## Three principles

- **One class, one job.** Small classes build up each look.
- **Styles in the page.** You rarely write a separate CSS file.
- **Only what you use.** The build drops every unused class.

## Related terms

- [Cascading Style Sheets (CSS)](https://learn.benibix.com/term/development/css)
- [CSS Selector](https://learn.benibix.com/term/development/css-selector)
- [UI Component](https://learn.benibix.com/term/development/component)
- [React](https://learn.benibix.com/term/development/react)
- [CSS Box Model](https://learn.benibix.com/term/development/css-box-model)
- [CSS Framework](https://learn.benibix.com/term/development/css-framework)
- [Bootstrap](https://learn.benibix.com/term/development/bootstrap)

## Told apart from

- [Bootstrap vs Tailwind CSS](https://learn.benibix.com/compare/bootstrap-vs-tailwind-css): People think Tailwind CSS is just another Bootstrap, and it is not. Bootstrap hands you whole ready parts, like a styled button or a menu, with one class each. Tailwind hands you small classes that each do one job, like a colour or a gap. You build each part from many of them, so pages look less alike.

## Taught in

- [CSS Frameworks and Sass](https://learn.benibix.com/learn/development-web/css-frameworks-and-sass): HTML, CSS and JS, 11/14

![Two ways to style one card. On the left, the page says div class="card", and a separate CSS rule for .card sets padding to 1rem and border-radius to 0.5rem. On the right, the page says div class="p-4 rounded-lg", with p-4 marked padding and rounded-lg marked round corners, and no separate rule.](https://learn.benibix.com/diagrams/dev-tailwind.svg)

---

Source: https://learn.benibix.com/term/development/tailwind-css
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
