Skip to content
OddsockLocal

CSS playground

Edit CSS against live sample HTML.

Runs in this browser. Nothing is uploaded.

How to use

  1. Leave Editor on CSS, or switch to HTML if the sample markup is what you want to change.
  2. Edit the sheet. The starting rule makes h1 italic.
  3. Press Run preview. The frame renders the allowlisted HTML and your CSS.
  4. Press Close preview to remove the frame. JavaScript stays empty unless you type some.

What is CSS playground?

CSS playground opens on the CSS editor. The sample document is already there: a heading that says Type specimen, a paragraph that says Edit this paragraph or its style, and CSS that sets a system font, one rem of padding, and an italic h1. Change the CSS, press Run preview, and the frame shows that document with your sheet. The Editor menu can switch to HTML or JavaScript, but the page starts you on the style.

Read more

The frame is sandboxed. HTML is copied through an allowlist of ordinary tags and a few attributes, so a script tag, an iframe or an event handler in the markup does not run. JavaScript, if you switch to it and type some, runs in a worker for at most five seconds, with a console and no document. The sample on this page leaves JavaScript empty, unlike the JavaScript playground, which starts on a snippet that logs 1, 4, 9 and clears the HTML.

Nothing is loaded from the network. Fonts, images and stylesheets you reference by URL will not arrive. The preview is a new frame each time you press Run preview. Close preview removes it.

Use cases

  • You want the heading italic, then not, and you want to see the sample paragraph move with the padding.
  • A snippet from a ticket should be tried without saving a file, and without the snippet’s script tags running.
  • You are checking that a URL in the CSS does not get fetched from this page.
  • The HTML playground is the one that starts in the markup. You came here to start in the CSS.

The sample sheet, before you edit it

Editor CSS. The starting sheet sets body to system-ui and 1rem padding, and h1 to italic. HTML is the Type specimen heading and one paragraph.

Run preview shows the heading in italic and the paragraph padded, inside the sandboxed frame. No external file is loaded.

Why use Oddsock

Starting on CSS is the point. The HTML playground uses the same frame and starts on the markup instead.

Related tools

Using this tool

No. Markup is copied tag by tag from an allowlist. script, iframe and event handlers are not copied. JavaScript runs only from the JavaScript editor, in a worker, with no DOM.