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="toggle-area">
  <div class="item">
    <input type="checkbox" id="sample-1" name="toggle1" value="1">
    <label for="sample-1">トグルボタン1</label>
  </div>
  <div class="item">
    <input type="checkbox" id="sample-2" name="toggle2" value="2">
    <label for="sample-2">トグルボタン2</label>
  </div>
  <div class="item">
    <input type="checkbox" id="sample-3" name="toggle3" value="3">
    <label for="sample-3">トグルボタン3</label>
  </div>
</div>
              
            
!

CSS

              
                div.item {
  margin: 15px;
}

div.toggle-area input[type="checkbox"] {
  display: none;
}

label {
  position: relative;
  padding-left: 60px;
  cursor: pointer;
}

label::before,
label::after {
  content: "";
  display: block;
  position: absolute;
  /* 位置調整 */
  top: 50%;
  left: 0px;
  /* 中央に揃える */
  transform: translateY(-50%);
  /* 枠線 */
  border: 1.4px solid rgba(0,0,0,.3);
  border-radius: 50%;
  /* アニメーションの変化時間 */
  transition: .2s;
}

label::before {
  /* 背景色 */
  background-color: rgba(0, 106, 182, .2);
  /* 枠線 */
  border: 1.4px solid rgba(0,0,0,.3);
  border-radius: 12px;
  /* サイズ調整 */
  height: 20px;
  width: 40px;
  /* 位置調整 */
  top: 50%;
  left: 5px;
}

label::after {
  /* 背景色 */
  background-color: #fff;
  /* 枠線 */
  border-radius: 50%;
  /* サイズ調整 */
  height: 23px;
  width: 23px;
  /* 位置調整 */
  top: 50%;
  left: 0px;
}

/* チェックありの場合 */
input:checked + label::before {
  /* 背景色 */
  background-color: rgb(0, 106, 182);
}

input:checked + label::after {
  /* トグルを右に移動させる */
  left: 26px;
}
              
            
!

JS

              
                
              
            
!
999px

Console