The Tailwind CSS Playground lets you write HTML with Tailwind utility classes and see a live, instant preview in the same window. There is no project setup, no build step, and no tailwind.config.js to scaffold — the Tailwind engine is loaded straight into the preview, so every utility class you type renders immediately. It is the fastest way to experiment with utility-first styling, prototype a component, or learn how a Tailwind class behaves.
Whether you are a frontend developer exploring an online Tailwind editor, a designer mocking up a card layout, or a learner comparing flex with grid, this playground keeps you in the flow. Tweak a class, watch the preview update, then copy or download the finished markup. Everything runs 100% client-side in your browser — your code is never uploaded or stored.
Because the preview is a sandboxed iframe with the Tailwind Play CDN injected, responsive prefixes like md:, state variants like hover: and focus:, and modern utilities such as gradients, transforms, and transitions all work exactly as they would in a real project.
Here is the same button with and without Tailwind. The unstyled element on the left is the browser default; on the right, a handful of utility classes turn it into a polished, interactive button — with no separate CSS file and no class names to invent.
Input (unstyled):
<button>Click me</button>Output (Tailwind utility classes):
<button class="bg-blue-600 hover:bg-blue-700 text-white font-semibold py-2 px-4 rounded-lg shadow-md transition-colors">Click me</button> Each class describes one visual decision: bg-blue-600 sets the background, hover:bg-blue-700 darkens it on hover, rounded-lg rounds the corners, and transition-colors animates the change. Together they express a complete style without writing a single line of CSS.
flex, p-6, text-2xl, or rounded-xl..html file.sm:, md:, lg:, hover:, focus:, active:, and dark: all work in the preview. Tailwind CSS is a utility-first CSS framework created by Adam Wathan and released in 2017. Instead of shipping prebuilt components like buttons or cards, Tailwind provides low-level utility classes — text-center, rounded-lg, flex, px-4 — that you compose directly in your HTML. The result is that styling stays co-located with your markup, and you rarely need to context-switch to a separate CSS file or invent semantic class names.
Under the hood, Tailwind scans your markup and generates only the CSS you actually use. Modern versions use a Just-In-Time (JIT) compiler, which produces styles on demand and keeps the final stylesheet tiny. The Play CDN loaded by this playground runs that same JIT engine in the browser, so it understands every utility, variant, and arbitrary value (such as bg-[#1da1f2]) without configuration.
A utility class maps to a single CSS property and a value drawn from Tailwind's design system. Composing several of them describes a complete element. Here is a small profile card built entirely from utilities:
<div class="flex items-center gap-4 p-6 bg-white rounded-xl shadow">
<img class="w-12 h-12 rounded-full" src="avatar.jpg" alt="Avatar" />
<div>
<h2 class="text-lg font-bold text-gray-900">Jane Doe</h2>
<p class="text-sm text-gray-500">Software Engineer</p>
</div>
</div>flex items-center gap-4 lays the avatar and text out in a row, rounded-xl shadow styles the container, and w-12 h-12 rounded-full crops the image into a circle. Nothing here required custom CSS.
Tailwind's variant prefixes let one element behave differently across breakpoints and interaction states. Prefix a class with a breakpoint to apply it from that size upward — so grid-cols-1 md:grid-cols-3 shows a single column on mobile and three columns from the medium breakpoint up:
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div class="p-4 bg-indigo-50 rounded-lg">Card 1</div>
<div class="p-4 bg-indigo-50 rounded-lg">Card 2</div>
<div class="p-4 bg-indigo-50 rounded-lg">Card 3</div>
</div> State variants work the same way: hover:bg-blue-700 changes the background on hover, focus:ring-2 adds a focus ring for keyboard users, and dark:bg-gray-900 adapts to dark mode. Combining responsive and state prefixes gives you fine-grained control from the markup alone.
Tailwind is often compared to component frameworks like Bootstrap and to hand-written CSS. Bootstrap gives you ready-made components (btn btn-primary) that are quick to use but harder to customize beyond their defaults. Tailwind hands you primitives instead, so every design decision is explicit and there is no fighting preset opinions. Compared to writing custom CSS, Tailwind keeps styles next to the element they affect and removes the naming and file-switching overhead.
If you prefer a visual, drag-and-drop way to assemble Tailwind layouts, try the Tailwind Layout Builder. For general HTML, CSS, and JavaScript experiments without Tailwind, the HTML Tryit Editor offers the same live-preview workflow. Once you are happy with your markup, tidy it with the HTML Beautifier or shrink it for production with the HTML Minifier.
pading-4 or bg-blue (missing the shade) silently does nothing. Double-check the class against the Tailwind docs — the engine ignores anything it does not recognize. md: apply from that width upward, not below it. Resize the preview pane wider to see them kick in, or confirm you wrote md:grid-cols-3 rather than grid-cols-3 alone. hover:bg-blue-700, with the colon). Some states only appear during real interaction, so hover or tab to the element in the preview. These companion tools round out a Tailwind workflow, from visual layout to clean, production-ready markup: