Fragment in the HTML pane
- Input
- <h1>Oi</h1>
- Expected output
- doctype + html lang + charset + viewport + title + body
All of that is generated around the fragment.
html boilerplate template
Paste a complete HTML5 skeleton into the HTML pane and the editor treats it as a whole document: it does not duplicate the doctype or head, it just slots the CSS and JavaScript from the other panes into the right places.
All of that is generated around the fragment.
Makes media queries respond to the preview width.
The pane is used as it is, and the other panes are fitted into it.
The CSS and the runtime need a head to go into.
The title is escaped and cannot close the tag or open a script.
Write in the three panes and the preview updates at once. There is no account, server or file: the browser builds a page with your HTML in the body, your CSS in a style tag and your JavaScript at the end of the body, and runs it all in an isolated iframe. The console shows whatever the code prints.
A doctype, an html tag with lang, a head with a charset and title, and a body. The viewport is not required by the specification, but it is essential for pages that will be viewed on a phone.
Without it browsers enter quirks mode, with old box-model and font-size rules. With the html doctype the page renders in standards mode.
It only adds: the console script after the opening tag and the pane CSS before the closing tag. The rest of your head stays as written, and the downloaded file carries no console script.
The preview runs isolated: your code cannot see cookies, storage or this site's page.
666 characters in total