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

              
                <div class="form">
  <h2><span>Modern</span>Food Restaurant</h2>
  <div class="note">Select starters:</div>
  <div class="inline-item">
    <input type="checkbox" id="opt1"/>
    <label for="opt1">Mushrooms</label>
  </div>
  <div class="inline-item">
    <input type="checkbox" id="opt2"/>
    <label for="opt2">French fries</label>
  </div>
  <div class="inline-item">
    <input type="checkbox" id="opt3"/>
    <label for="opt3">Devilled chicken</label>
  </div>
  
  <div class="spacer"></div>
  
  <div class="note">Select a main dish:</div>
  <div class="inline-item">
    <input type="radio" id="opt1" name="maindish"/>
    <label for="opt1">Sandwiches</label>
  </div>
  <div class="inline-item">
    <input type="radio" id="opt2" name="maindish"/>
    <label for="opt2">Pasta</label>
  </div>
  <div class="inline-item">
    <input type="radio" id="opt3" name="maindish"/>
    <label for="opt3">Pizza</label>
  </div>
  
  <div class="spacer"></div>
  
  <div class="note">Spice level:</div>
  <input type="range" min="1" max="5" list="markers"/>
  <datalist id="markers">
    <option value="1"></option>
    <option value="2"></option>
    <option value="3"></option>
    <option value="4"></option>
    <option value="5"></option>
  </datalist>
  
  <div class="spacer"></div>
  
  <div class="note">Order progress:</div>
  <progress max="100" value="70"> 70% </progress>
  
  <div class="spacer"></div>
<div>
              
            
!

CSS

              
                /* Styling the form and text elements */

.form {
  background-color: #eee;
  padding: 24px;
  border-top: solid 10px #bb0000;
}

.spacer {
  height: 24px;
}

.inline-item {
  display: flex;
  align-items: center;
}

h2 span {
  color: red;
}

.note {
  padding-bottom: 12px;
}

label {
  padding-left: 6px;
}

/* Styling form controls */

input[type="checkbox"], 
input[type="radio"], 
input[type="range"],
progress {
  accent-color: red;
  width: 20px;
  height: 20px;
}

input[type="radio"] {
  margin: 3px;
  drop-shadow: 12px 12px;
}

input[type="range"], progress {
  width: 300px;
}

/* Dark theme-specific */

@media (prefers-color-scheme: dark) {
  .form {
    background-color: black;
    color: white;
  }
  
  input[type="checkbox"], 
  input[type="radio"], 
  input[type="range"],
  progress {
    accent-color: white;
    color-scheme: dark;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console