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


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import or require. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.


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.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <div style="margin: 2em auto; max-width: 400px;">

  <form novalidate>

    <div class="input-wrap">
      <label for="n">
        Name (not required):
      <input type="text" id="n" class="txt-field" aria-describedby="n_msg">
      <span id="n_msg">Try not to be clever</span>

    <div class="input-wrap">
      <label for="e">
      <input type="email" id="e" class="txt-field" aria-invalid="false" required data-error="e_msg" aria-describedby="e_msg" data-msg="Your email is required.">
      <span id="e_msg"></span>

    <div class="input-wrap">
      <label for="num">
      <input type="number" id="num" class="txt-field" aria-invalid="false" required data-error="nu_msg" aria-describedby="nu_msg" data-msg="A numeric value must be entered.">
      <span id="nu_msg"></span> 

    <div class="input-wrap">
      <label for="rn2">
        Name (no default invalid false):
      <input type="text" id="rn2" class="txt-field" data-error="rn2_mess" aria-describedby="rn2_mess" data-msg="Your name is required." required>
      <span id="rn2_mess"></span>

    <div class="input-wrap">
      <label for="rn2bbb">
      </label> <span id="help">(first and last)</span>
      <input type="text" id="rn2bbb" class="txt-field" data-error="rn2bbb_mess" aria-describedby="rn2bbb_mess help" data-msg="Your name is required." required aria-invalid="false">
      <span id="rn2bbb_mess"><!-- populate error message here as needed --></span>

    <div class="input-wrap">
      <label for="rn">
      <input type="text" id="rn" class="txt-field" aria-invalid="false" data-error="rn_mess" aria-describedby="rn_mess" data-msg="Your name is required." required>
      <span id="rn_mess"></span>

    <div class="input-wrap">
      <label for="req_mess">
        Message (req):
      <textarea id="req_mess" class="txt-field" data-msg="You must enter a message." aria-invalid="false" data-error="rmess_msg" aria-describedby="rmess_msg" required></textarea>
      <span id="rmess_msg"></span>

    <button style="margin-top: 2em;
                   border: 2px solid;
                   padding: .5em 2em;
                   font-size: inherit;"

body {
  background: #fcfcfc;
  font-family: arial;
  font-size: 100%;
  margin: 0;
  padding: 0;

*:after {
  box-sizing: border-box;

body {
  line-height: 1.4;

.input-wrap:not(:first-of-type) {
  margin-top: 1.5em;

.txt-field {
  border: 1px solid #63738a;
  box-shadow: none;
  font-size: inherit;
  padding: .5em;
  width: 100%;

.txt-field[disabled] {
  background: #e8ebf0;

.txt-field[readonly] {
  background: #fafafa;

.txt-field:hover:not([disabled]) {
  outline: 1px solid #63738a;

.txt-field:focus {
  border-color: #0062b2;
  outline: 1px solid #0062b2;

.txt-field[aria-invalid="true"]:invalid:not(:focus) {
  border-color: #d6312b;
  outline: 1px solid #d6312b;

.txt-field[aria-invalid="true"] + span {
  color: red;
  font-weight: bold;

textarea.txt-field {
  resize: vertical;
  max-height: 10em;
  min-height: 4em;

              (function () {
  var fields = document.querySelectorAll('.txt-field[required]');

  var checkIt = function ( e ) {
    var msg;

    if ( this.hasAttribute('data-msg') ) {
      msg = document.getElementById(this.getAttribute('data-error'));

    if ( this.required && this.validity.valid ) {
      this.setAttribute('aria-invalid', 'false');
      msg.innerHTML = '';
      this.removeEventListener('keyup', checkIt, false);
    else if ( this.required && !this.validity.valid  ) {
      this.setAttribute('aria-invalid', 'true');
      msg.innerHTML = this.getAttribute('data-msg');
      this.addEventListener('keyup', checkIt, false);


  for ( var i = 0; i < fields.length; i++ ) {
    fields[i].addEventListener('blur', checkIt, false);