Pen Settings

HTML

CSS

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

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

Auto Save

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

              
                <h1>Example</h1>

<form>
  <p>* indicates a field is required</p>
  <div>
    <label for="first">First Name:
      <input type="text" id="first" name="first"></label>
  </div>
  <div>
    <label for="last">Last Name: *
      <input type="text" id="last" name="last" required>
    </label>
  </div>
  <div>
    <label for="term">Term: *
      <input type="text" id="term" name="term" required pattern="\d" placeholder="digits only" aria-describedby="desc-term">
      <span id="desc-term">Term must be a single digit.</span>
    </label>

  </div>

  <fieldset>
    <legend>Campus</legend>
    <label for="dav">
      <input type="radio" id="dav" name="campus" value="D">Brampton
    </label>

    <label for="hmc">
      <input type="radio" id="hmc" name="campus" value="M">Mississauga
    </label>

    <label for="traf">
      <input type="radio" id="traf" name="campus" value="O" checked>Oakville
    </label>
  </fieldset>
  <div><input type="submit" value="Submit"></div>
</form>
              
            
!

CSS

              
                /* basic styling */
html, body {
  font: 20px Arial,sans-serif;
}
div {
  margin: 0.3em 0.1em;
}
fieldset > label {
  margin-right: 0.75em;
}

/* validation stuff */
input:required {
  background-color: #fff9c4;
}

/* if you add a background colour for invalid fields, 
this background colour will override the background 
colour set on :required fields when those :required 
fields are empty - try it! */
input:invalid {
  /*background-color: #FFCDD2;*/
  outline: 0.15em solid red;
}

              
            
!

JS

              
                
              
            
!
999px

Console