Tailwind Garden — Tailwind CSS

Grow a garden with Tailwind: 78 levels of utility classes for flex, grid, typography and animation. The most complete Tailwind CSS game around.

What you learn in this game

Tailwind has fraction classes for width: w-1/2 (50%), w-1/3 (33%), w-1/4 (25%). For height, use fixed numbers: h-8 (2rem), h-16 (4rem), h-32 (8rem).

max-w-{size} caps an element's maximum width (sm=24rem, md=28rem, lg=32rem). Combine it with mx-auto (automatic left-right margin) for centering: the most common trick in CSS.

The opacity-{value} class sets an element's transparency. A value of 0 = invisible, 50 = half-transparent, 100 = fully visible.

text-center centers the text. uppercase turns every letter into capitals. tracking-wide adds space between letters, great for headings and labels.

What the levels ask

  1. Tap each class to see its padding effect on the box. Notice how the inner space changes.
  2. Which class adds padding (inner space) to every side of an element?
  3. Add padding to the box so the text doesn't hug the edges.
  4. Tap each class to see its margin effect. Notice the box's distance from the edge.
  5. Which class adds margin (outer space) to every side?
  6. Add margin so the box keeps some distance from the edge.
  7. Give it bigger horizontal padding and smaller vertical padding, like a button.
  8. Which class makes an element as wide as its parent (100%)?
  9. Make this element as wide as its parent, filling the whole row.
  10. Set this box to half the screen width and a fitting height.
  11. Limit the box's width, then center it horizontally.
  12. Build a card that's centered, with the right padding and width.

And more, 78 levels in all.