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


  <input type="checkbox" checked="checked" />
  <input type="checkbox" />


                /* Make things pretty */
body {
  font: 14px/20px Arial, sans-serif;
  background: #ddd;
  margin: 4em auto;
  width: 200px;
  color: #444;
label {
  background: #fff;
  border: 1px solid #bbb;
  display: block;
  border-radius: 10px;
  padding: 1em;
  margin: 0 0 1em;
  position: relative;
  cursor: pointer;
label span {
  padding-right: 2em;
  width: 5em;
  display: inline-block;

/* Mask the checkbox under the :after */
input[type=checkbox] {
  margin-left: 3em;
/* Insertion of modified checkbox states */
input[type=checkbox]:after {
  /* Default off state */
  content: "Off";
  /* Display */
  position: absolute;
  z-index: 1;
  margin: -1.1em 0 0;
  top: 50%;
  right: 1em;
  display: inline-block;
  background: #ff9999;
  padding: 0.5em 1em;
  width: 4em;
  border-radius: 1em;
    inset 1px 1px 1px rgba(0,0,0,0.3);
  color: #cc3333;
    1px 1px rgba(255,255,255,0.4);
  text-transform: uppercase;
  font-size: 11px;
  text-align: left;
input[type=checkbox]:checked:after { 
  /* State */
  content: "On";
  /* Display */
  text-align: right;
  background: #9ad179;
  color: #669933;

/* Visual indicator */
input[type=checkbox]:before {
  content: "";
  position: absolute;
  z-index: 2;
  width: 1.6em;
  height: 1.6em;
  top: 50%;
  margin-top: -0.8em;
  right: 1em;
  background: #eee;
  border-radius: 1em;
    0 1px 1px #999,
    inset 0 3px 4px #fff;
  transition: right 0.05s linear;
input[type=checkbox]:checked:before {
  right: 4em;


  Works in Webkit only, as other
  browsers do not recognise input
  (self-closing elements) as valid
  targets for :before or :after.
  Degrades nicely into a regular
  checkbox on unsupported platforms