Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <h1>This is a header</h1>

<p>I inherited blue from the root element!</p>
<div>I got green set directly on me!</div>
<div id="alert">
  While I got red set directly on me!
  <p>I’m red too, because of inheritance!</p>
<div id="computed_style"></div>
<p><button id="change_doc_color" onclick="changeDocColor()">Change document color to green</button></p>

<br />
<br />
<br />
<br />
<br />
<br />
<hr />
<p>If you find this demo useful, please consider <a href="" target="_blank">donating $1 dollar</a> for a coffee or purchasing one of my songs from <a href="" target="_blank"></a> or <a href="" target="_blank"></a> for only 0.99 cents each. I have also released CDs with my band <a href="" target="_blank">Ivory Knight</a> and Annihilator main-man Jeff Waters.</p>
<p>Rob uses and recommends <a href="" target="_blank">MochaHost</a>, which provides Web Hosting for as low as $1.95 per month, as well as unlimited emails and disk space!</p>


                h1 { --main-color: #06c; }
h1 { color: var(--main-color); }

:root { --color: blue; --new-color: green; --font-size-factor: 2.5; }
div { --color: green; --pad: 10px 10px 20px 15px; }
#alert { --color: red; }
* { color: var(--color); }

div > p { 
  padding: var(--pad, 10px 10px 10px); 
  font-size: calc(var(--font-size-factor) * 1em);


                var elem       = document.getElementById("alert"),
    theCSSprop = window.getComputedStyle(elem, null).getPropertyValue("--color").trim(),
    msgElt     = document.getElementById("computed_style");

msgElt.innerHTML = "The alert div's color is \"<span style='color:" + theCSSprop + "'>" + theCSSprop +'</span>".';

function changeDocColor() {'--color', 'var(--new-color)');