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="widget-wrap">
  <div id="check"></div>
  <h1>CUSTOM RADIO CHECKBOX</h1>
  
  <!-- (A) CHECKBOX -->
  <div class="cbox">
    <input type="checkbox" name="checkA" id="checkA">
    <label for="checkA">Checkbox</label>
  </div>

  <!-- (B) RADIO BUTTONS -->
  <div class="cbox">
    <input type="radio" name="radioB" id="radioB1">
    <label for="radioB1">Radio</label>
  </div>
  <div class="cbox">
    <input type="radio" name="radioB" id="radioB2">
    <label for="radioB2">Radio</label>
  </div>

  <!-- (C) DISABLED CHECKBOX & RADIO BUTTON -->
  <div class="cbox">
    <input type="checkbox" name="checkC" id="checkC" disabled>
    <label for="checkC">Disabled Checkbox</label>
  </div>
  <div class="cbox">
    <input type="radio" name="radioD" id="radioD2" disabled>
    <label for="radioD2">Disabled Radio</label>
  </div>
  
  <!-- (X) VISIT CODE-BOXX -->
  <div id="code-boxx">
    Visit
    <a href="https://code-boxx.com/simple-pure-css-custom-checkbox/"
       target="_blank">
      Code Boxx
    </a> for more details.
  </div>
</div>
              
            
!

CSS

              
                /* (A) HIDE ORIGINAL CHECKBOX/RADIO */
.cbox input { display: none; }

/* (B) ICON TO SHOW WHEN CHECKED */
.cbox input:checked ~ label::before { content: "\2605"; }

/* (C) CUSTOM CHECKBOX SQUARE */
.cbox label::before {
  display: inline-block;
  content: "\00a0"; /* Blank space */
  width: 25px;
  margin-right: 5px;
  text-align: center;
  background: #f2f2f2;
}

/* (D) MORE COSMETICS */
.cbox {
  font-size: 18px;
  line-height: 20px;
  margin: 10px;
}
.cbox label { cursor: pointer; }
.cbox label:hover::before { background: #ddd; }

/* (E) DISABLED CHECKBOXS & RADIO BUTTONS */
.cbox input:disabled ~ label { color: #aaa; }
.cbox input:disabled ~ label::before { background: #ccc; }

/* (X) DOES NOT MATTER */
/* ENTIRE PAGE */
* {
  font-family: arial, sans-serif;
  box-sizing: border-box;
}
body {
  display: flex;
  align-items: center; justify-content: center;
  min-height: 100vh;
  background-image: url(https://images.unsplash.com/photo-1528459801416-a9e53bbf4e17?crop=entropy&cs=srgb&fm=jpg&ixid=MnwxNDU4OXwwfDF8cmFuZG9tfHx8fHx8fHx8MTY0NDI5MDQ4OA&ixlib=rb-1.2.1&q=85);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* WIDGET WRAPPER */
.widget-wrap {
  min-width: 500px;
  padding: 30px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
}

/* SVG */
#check {
  width: 100px; height:100px;
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 512 512" width="100" xmlns="http://www.w3.org/2000/svg"><path d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z" /></svg>');
  background-repeat: no-repeat;
  background-position: center;
}

/* FOOTER */
#code-boxx {
  font-weight: 600;
  margin-top: 50px;
}
#code-boxx a {
  display: inline-block;
  padding: 5px;
  text-decoration: none;
  background: #b90a0a;
  color: #fff;
}

              
            
!

JS

              
                
              
            
!
999px

Console