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="container">
 <label class="switch">
  <input type="checkbox">
  <span class="slider">
  <svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" style="fill:#ffffff;transform:;-ms-filter:"><path d="M10 15.586L6.707 12.293 5.293 13.707 10 18.414 19.707 8.707 18.293 7.293z"></path></svg>
    

          <svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" style="fill:#ffffff;transform:;-ms-filter:"><path d="M16.192 6.344L11.949 10.586 7.707 6.344 6.293 7.758 10.535 12 6.293 16.242 7.707 17.656 11.949 13.414 16.192 17.656 17.606 16.242 13.364 12 17.606 7.758z"></path></svg>
  </span>
</label>
</div>
              
            
!

CSS

              
                body{
display:flex;
justify-content:left;
align-items:left;
}

.container {
  padding: 16px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  display:none;
}

.slider .fa-check {
  color: #FFFFFF;
  position:absolute;
  left:15px;
  font-size:16px;
  display:none;
}
.slider .fa-times {
  color: #FFFFFF;
  position:absolute;
  font-size:16px;
  right:15px; 
}

.slider {
  position: absolute;
  cursor: pointer;
  display:flex;
  align-items:center;
  top:0;
  left:0;
  right:0;
  bottom:0;
  background-color: #D22530;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius:50px;
}

.slider:before {
  position: absolute;
  content:"";
  height: 26px;
  width: 26px;
  left: 5px;
  bottom: 4px;
  border-radius:50%;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

.switch input:checked + .slider .fa-check {
  display:block;
}

.switch input:checked + .slider .fa-times {
  display:none;
}

.switch input:checked + .slider {
  background-color: #509E2F;
}

.switch input:focus + .slider {
  box-shadow: 0 0 1px #509E2F;
}

.switch input:checked + .slider:before {

  -webkit-transform: translateX(25px);
  -ms-transform: translateX(25px);
  transform: translateX(25px);
}


              
            
!

JS

              
                
              
            
!
999px

Console