CSS Playground

Put some HTML in one box and CSS in the other, and the result updates as you type. It is a quick place to try a flexbox or grid layout, tune a hover effect or check how a selector matches, without setting up a project. Everything runs in your browser in a sandboxed frame.

Ctrl + Enter in an editor
Result

Your code runs in a locked-down frame in your browser: it cannot read this site, your cookies or other tabs, and it has no network access, so fetch() and external files are blocked. Nothing is uploaded or saved; download the .html to keep your work.

Features

  • HTML and CSS editors side by side with a live result

  • Updates about half a second after you stop typing

  • Starts with a pill menu and responsive grid sample to edit

  • Tab key indents inside the editors

  • Download the HTML and CSS as one .html file

  • Runs in a sandbox with no network access

Good uses for a CSS playground

Getting a layout right

Try grid-template-columns, gap and flex-wrap values on real boxes until the layout works, then copy the rules into your stylesheet.

Understanding a selector

Check whether .menu a.active or .card:hover > p matches the element you expect by watching which parts of the HTML change.

Tuning colours and spacing

Adjust padding, border-radius, shadows and colours and see them immediately, which is faster than saving and reloading a site.

Tips for the CSS playground

Testing responsive CSS

Media queries respond to the width of the result frame, not your whole screen. On a laptop the frame is about half the window wide, so a @media (max-width: 640px) rule may already apply. Make the browser window narrower or wider to test breakpoints.

What does not load

  • External stylesheets and fonts (Google Fonts, Bootstrap, Tailwind CDN) are blocked, because the sandbox has no network access. System fonts and fonts embedded as data: URLs work.
  • Background images from URLs are blocked; use a gradient or a data: URL instead.
  • Need JavaScript too? Use the HTML, CSS and JS playground, which adds a script editor and a console.

CSS Playground - FAQ