How to Prototype Front-End Code in a Live HTML, CSS and JS Playground
Prototype web pages with live preview: split editors, npm modules through import maps, console debugging, responsive widths and exporting a project ZIP.

How to Prototype Front-End Code in a Live HTML, CSS and JS Playground
Many front-end ideas are best tested outside your project: a CSS layout trick, a small component, a reduced test case for a bug report, or an example for a student. A live playground gives instant feedback without a build setup. This guide covers a productive workflow with the free HTML CSS JS live playground.
Keep the three languages apart
Put structure in the HTML editor, appearance in the CSS editor and behaviour in the JavaScript editor. The preview combines them in a sandboxed frame and refreshes shortly after you stop typing. If your script is heavy or animates continuously, switch off auto-run and press Ctrl+Enter when you are ready. Keeping concerns separate also makes the exported project tidy: index.html, style.css and script.js.
Use modern JavaScript modules
Browsers understand ES modules natively, so you can write import statements without a bundler. To use an npm package, add its name and an exact version in the packages list. The playground adds an import map that points the bare name to esm.sh, a CDN that serves npm packages as browser modules. Pin versions: a project that imports the latest version today may break when a new major version appears. Packages that depend on Node.js built-ins such as fs will not work in the browser.
Classic libraries that expect a global variable can still be added as external script URLs, and CSS frameworks as stylesheet URLs. Extra head tags cover web fonts and meta tags.
Debug with the console panel
The console under the preview receives everything the page logs: console.log, warnings, errors, uncaught exceptions with their line numbers and unhandled promise rejections. Repeated messages are grouped with a counter, which keeps animation loops readable. The input line runs JavaScript inside the preview, so you can inspect document.title, call a function or change a variable without editing the code. When something fails silently, look here first.
Check responsive layouts
Switch the preview width between phone, tablet and laptop sizes. Layout bugs often appear only at 390 pixels: long words that do not wrap, fixed widths, images without max-width. Fix them with flexible units, min() and clamp(), and media queries, and check again. For a full-size view, open the preview in a new tab.
Build reduced test cases
When you report a bug to a library or browser vendor, the best report is a minimal page that shows the problem. Start from the blank template, add only the library and the few lines needed, and confirm the bug still appears. Export it as a single HTML file or share link and attach it to the issue. Maintainers fix reproducible bugs far faster.
Share and hand over
Copy share link compresses the whole project into the link, after the # sign, so no server stores it. Export ZIP produces a small project that opens in any editor and can be served locally with a static server such as npx serve, which is needed when the code uses modules. Importing a ZIP or an HTML file brings a project back into the editors.
Teaching with the playground
Teachers can prepare a starting project with HTML and CSS done and a JavaScript task left open, then share the link. Students get their own copy, saved in their browser, and the console makes errors visible instead of a blank page. Because the preview is sandboxed, students cannot break the page around it.
Limits
The sandbox isolates the preview from this site, so features that need a real origin, such as service workers, some storage APIs, camera prompts or cookies, may not work inside it; test those from an exported project on a local server. There is no compile step for TypeScript, JSX or Sass, and very large projects belong in a proper editor and build tool.



