India · Dubai · Delivering worldwide+91 86603 71224info@pyalm.com
Pyalm Labs logo
Free Tools

Tailwind CSS for Beginners: Utility Classes Explained (Try Them Live)

What utility-first CSS is, the Tailwind classes you'll use most, how responsive and hover variants work, and a free playground to practise in.

Editorial disclosure: Pyalm publishes and maintains the products and free tools discussed on this site. Regulatory statements are linked to primary sources where applicable. No independent professional review is claimed unless a reviewer is explicitly named.

Tailwind CSS replaces writing custom CSS rules with small, single-purpose classes applied directly in your HTML. class="p-6 rounded-2xl bg-white shadow-lg" gives you padding, rounded corners, a white background and a shadow — no stylesheet needed.

Why teams use it

  • Speed — style without switching files or naming things.
  • Consistency — spacing, colours and font sizes come from one scale.
  • Small CSS — only the classes you use end up in production.
  • Easy to change — styles live with the markup, so deleting a component deletes its styles.

The classes you'll use most

Purpose Examples
Spacing p-4 px-6 mt-2 gap-3 space-y-2
Sizing w-full max-w-md h-40
Layout flex grid grid-cols-3 items-center justify-between
Typography text-sm text-2xl font-bold text-slate-600 leading-tight
Colour bg-emerald-600 text-white border-slate-200
Borders border rounded-lg rounded-full
Effects shadow-lg opacity-50 ring-2

Variants: responsive, hover, dark

Prefix a class to apply it conditionally:

  • md:grid-cols-3 — three columns from the medium breakpoint up (mobile-first)
  • hover:bg-emerald-700 — on hover
  • focus:ring-2 — when focused
  • dark:bg-slate-900 — in dark mode

Arbitrary values

Need something off the scale? Use square brackets: bg-[#2E8B57], w-[340px], shadow-[0_4px_12px_rgba(0,0,0,0.08)].

Practise in the browser

The free Tailwind CSS Playground runs Tailwind v4 in an isolated preview. Start from a card, pricing table, hero or form template, edit the classes, and switch between mobile, tablet and desktop widths to see responsive variants work. Your last edit is saved in your browser.

Tailwind v4 in brief

Version 4 is configured in CSS rather than tailwind.config.js:

@import "tailwindcss";
@theme {
  --color-brand: #2E8B57;
}

Then bg-brand and text-brand just work.

Keep markup readable

Extract repeated patterns into components (React, Vue, Blade) rather than copying long class lists. Use the official Prettier plugin to sort classes consistently.

Rather have it built?

Pyalm designs and builds fast, conversion-focused websites in Next.js — the same stack these tools run on — with a consistent design system, accessible colours and technical SEO built in.

Tailwind Playground | Flexbox Playground | Color Converter | Box Shadow Generator | All free tools

Keep reading

More from Pyalm

Nov 27, 2026

Prescription Abbreviations: What OD, BD, TDS, SOS and 1-0-1 Mean

A plain-English list of prescription abbreviations: dose timing (OD, BD, TDS, QID), when to take (AC, PC, HS, SOS), routes, forms, the 1-0-1 dose grid and abbreviations to avoid.

Nov 27, 2026

Handwritten vs Typed Prescriptions: Which Is Safer?

Why legibility matters in prescribing, what changes when clinics move from handwritten to typed or electronic prescriptions, and how to keep a handwritten signature.

Nov 27, 2026

How to Write a Prescription in India: Format and Rules

A practical prescription format for doctors in India: required details, generic names in capitals, the 1-0-1 grid, Schedule H and controlled drugs, and keeping records.

Nov 27, 2026

Prescription Pad Design: Letterhead Template for Clinics

What a professional prescription letterhead should include, paper size, layout, bilingual Arabic and English pads, QR codes for verification and printing tips.

Nov 27, 2026

Prescription Errors: 10 Common Mistakes and How Clinics Prevent Them

The ten prescription mistakes that cause dispensing errors, from illegible names and decimal points to missing durations, and simple fixes for clinics.

Oct 16, 2026

How to Format and Validate JSON (and Fix the 6 Most Common Errors)

Why JSON breaks, how to read a validator's error message, and a quick routine for pretty-printing, minifying and fixing JSON from APIs, logs and config files.

Try the free Tailwind CSS Playground

Pyalm designs and builds fast, conversion-focused websites in Next.js — the same stack these tools run on. If you'd rather have it built than fiddle with CSS, talk to us.

Open Tailwind CSS Playground See website development All free tools