Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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.


                <div id="container">
  <h1>My Awesome Site</h1>

  <p>Please subscribe to my newsletter.</p>
  <p>It's very important and I promise not to misuse your email address.</p>
  <p>Although, saying that, I might sell it.</p>
  <p>I mean, I gotta earn a living, right?</p>

  <label for="myInput">Type something:</label>
  <input placeholder="Type something" id="myInput">
  <button class="button clear-cookie">Clear Cookie</button>

<div id="modal-content">
  <h2>I Can Haz Email?</h2>
  <label for="yurEmail">Yur Email Adress:</label>
  <input placeholder="I needz it" id="yurEmail">
  <button class="button order-cheezburger">Order Cheezburger</button>



html {
  font-family: arial;
  background: #fffff0;
  color: #8f1f08;
  font-size: 20px;
  line-height: 1.3;
  margin: 0;
  padding: 0;

#container {
  width: 650px;
  padding: 10px;
  margin: 0 auto;

h2 {
  color: #2B292E

input {
  border: 1px solid #333;
  margin-bottom: 15px;
  min-width: 250px;
  padding: 8px;

.button {
  transition-duration: 0.4s;
  background: #720000;
  border: none;
  color: white;
  padding: 10px 20px;
  display: block;
  font-size: 16px;
  margin: 10px 2px;
  cursor: pointer;

button.button:hover {
  background: #990000

#cboxLoadedContent {
  padding: 10px;
  background: #fffff0;

#modal-content {
  display: none;

#modal-content label {
  display: block;
  margin-bottom: 5px;

#modal-content input {
  width: 95%;


                $(".clear-cookie").on("click", function() {
  $(this).replaceWith("<p><em>Cookie cleared. Re-run demo</em></p>");

$(".order-cheezburger").on("click", function() {

function onPopupOpen() {

function onPopupClose() {
  Cookies.set('colorboxShown', 'yes', {
    expires: 1

function displayPopup() {
    inline: true,
    href: "#modal-content",
    className: "cta",
    width: 600,
    height: 350,
    onComplete: onPopupOpen,
    onClosed: onPopupClose

var lastFocus;
var popupShown = Cookies.get('colorboxShown');

if (popupShown) {
  console.log("Cookie found. No action necessary");
} else {
  console.log("No cookie found. Opening popup in 3 seconds");
  setTimeout(function() {
    lastFocus = document.activeElement;
  }, 3000);