Pen Settings

HTML

CSS

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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <div class="input-row">
  <label>
    Name

    <input class="input text-input" autofocus/>
  </label>
</div>

<div class="input-row">
  <label>
    Favourite icecream flavor

    <select class="select">
      <option>Chocolate</option>
      <option>Tuna</option>
      <option>Liquid nitrogen</option>
    </select>
  </label>
</div>

<div class="input-row">
  <label>
    More about you

    <textarea class="textarea text-input" rows="4"></textarea>
  </label>
</div>

<div class="input-row">
  <label>
    <input type="checkbox" />
    
    I like puppies
  </label>
</div>

<div class="input-row">
  <button class="button">Submit</button>
</div>

<div class="input-row">
  <a href="#0">Privacy policy</a>
</div>
              
            
!

CSS

              
                body {
  font-family: sans-serif;
  font-size: 18px;
}

.input-row {
  margin: 30px auto;
  width: 100%;
  max-width: 400px;
}

.input,
.select,
.textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  font-size: 18px;
  border: 1px solid lightgrey;
  margin-top: 5px;
  font-family: inherit;
}

input[type=checkbox] {
  transform: scale(1.3)
}

.button {
  padding: 10px;
  width: 100%;
  border: none;
  font-size: 18px;
  background: crimson;
  color: white;
}

.button:hover {
  background: #ce1034;
}

.button:active {
  background: #a70f2c;
}

/* a subtle focus style for keyboard-input elements */
.text-input:focus {
  outline: 1px solid #aaa;
}

/* no focus style for non-keyboard-inputs elements */
button:focus,
select:focus {
  outline: none;
}

/* and for keyboard users, override everything with
   a Big Blue Border when focused on any element */
body.user-is-tabbing *:focus {
  outline: 2px solid #7AACFE !important; /* for non-webkit browsers */
  outline: 5px auto -webkit-focus-ring-color !important;
}

              
            
!

JS

              
                function handleFirstTab(e) {
  if (e.keyCode === 9) {
    document.body.classList.add('user-is-tabbing');
    window.removeEventListener('keydown', handleFirstTab);
  }
}

window.addEventListener('keydown', handleFirstTab);
              
            
!
999px

Console