Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <fieldset>
  <input class="radio triangle" type="radio" id="triangle" name="shapes" checked>
  <label for="triangle">Triangle</label>
  <input class="radio circle" type="radio" id="circle" name="shapes">
  <label for="circle">Circle</label>
  <input class="radio square" type="radio" id="square" name="shapes">
  <label for="square">Square</label>
</fieldset>

<fieldset>
  <input class="radio cat" type="radio" id="cat" name="animals" checked>
  <label for="cat"></label>
  <input class="radio dog" type="radio" id="dog" name="animals">
  <label for="dog">Dog</label>
</fieldset>
              
            
!

CSS

              
                /* You could choose to override all browser styles on all your inputs, but I prefer explicit classes */
.radio {
  /* secret sauce to styling radio buttons */
  appearance: none;
  -webkit-appearance: none;
  -mozilla-appearance: none;
  /* Aligning your label text and your radio */
  vertical-align: text-bottom;
}

/* Setting the checked styles */
.radio:checked {
  border-color: pink;
}

.triangle {
  border: 20px solid red;
  border-top: 15px solid transparent;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
}

.triangle:checked {
  border-bottom-style: double;
  border-top: 15px solid transparent;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
}

.circle {
  border: 10px solid red;
  border-radius: 100%;
}

/* radio outer circle */
.circle:checked {
  border-width: 5px;
}

/* radio inner negative circle */
.circle:checked:before {
  content: "";
  height: 10px;
  width: 10px;
  display: block;
}

.square {
  border: 10px solid red;
}

/* creating the illusion of inner and outer elements with double borders */
.square:checked {
  border-style: double;
}

/* you can even use images */

.dog {
  background: url('https://s3.amazonaws.com/gaslight-blog/til-styling-radio-buttons/photo.jpg');
  background-size: auto 80px;
  display: block;
  height: 60px;
  width: 80px;
  opacity: 0.5;
}

.dog:checked {
  opacity: 1;
}

.cat:after {
  content: "CAT";
}

.cat:checked:after {
  content: "CAT CHECKED";
}
              
            
!

JS

              
                
              
            
!
999px

Console