Pen Settings



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


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.


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.


  <h2>Custom Radio Buttons and Checkboxes with CSS</h2>

    <legend>Which Do You Prefer?</legend>
    <label for="veg"><input type="radio" id="veg" value="vegetables" name="prefer" checked required>Vegetables</label>
    <label for="pizza"><input type="radio" id="pizza" value="pizza" name="prefer" required>Pizza</label>
    <legend>How Do You Like Your Eggs?</legend>
    <label for="sunny"><input type="checkbox" id="sunny" value="sunny" name="eggs" checked required>Sunny Side Up</label>
    <label for="overeasy"><input type="checkbox" id="overeasy" value="overeasy" name="eggs" required>Over Easy</label>


                body {
  font-family: Arial, sans-serif;
  font-size: 20px;
  padding: 0 20px;

main {
  text-align: center;
  margin: 0 auto;
  max-width: 800px;

p {
  text-align: left;
  padding: 0 20px;

code {
  color: firebrick;

fieldset {
  margin-bottom: 40px;
  border-radius: 10px;
  padding: 30px;

/* Context for relative positioning */
label {
  position: relative;

/* Base styles for both types of inputs */
input[type="checkbox"] {
  appearance: none;
  background: #fff;
  border: 2px solid #777;
  height: 1.5em;
  width: 1.5em;
  margin: 0 10px 0 30px;
  border-radius: 100%;
  vertical-align: text-bottom;
  position: relative;

/* Remove the circular shape from checkboxes */
input[type="checkbox"] {
  border-radius: 0;

/* Styles for the pseudo-elements */
input[type="checkbox"]::before {
  content: "";
  position: absolute;
  margin: auto;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  top: 0;

/* Center of the checked radio button */
input[type="radio"]:checked::before {
  border: 5px solid transparent;
  border-radius: 100%;
  background: hotpink;
  margin: 4px;

/* The checkmark shape */
input[type="checkbox"]:checked::before {
  border-right: 5px solid hotpink;
  border-bottom: 6px solid hotpink;
  height: 90%;
  width: 30%;
  transform: rotate(50deg) translateY(-20%) translateX(-10%);

/* Some focus styles for accessibility */
input[type="checkbox"]:focus {
  outline: solid 1px;
  outline-offset: 2px;