Pen Settings



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


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.


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.


    <label class="active">
      <input type="radio" name="class" value="container--one" class="radio" checked="checked">
      <input type="radio" name="class" value="container--two" class="radio">
      <input type="radio" name="class" value="container--three" class="radio">
      <code>column wrap</code>
      <input type="radio" name="class" value="container--four" class="radio">
      <code>row-reverse wrap</code>

<div class="container container--one" id="container">
    <strong>Item 1:</strong> Lorem ipsum dolor sit amet consectetur adipisicing elit. 
    <strong>Item 2:</strong> Quisquam facilis dolore accusantium voluptatem suscipit.   
    <strong>Item 3:</strong> Voluptas illo non consequuntur.


                .container--one {
  flex-flow: column;

.container--two {
  flex-flow: wrap;

.container--three {
  flex-flow: column wrap;

.container--four {
  flex-flow: row-reverse wrap;

/* ETC (Formatting only): */

body {
  margin: 1.5em;
  font-size: 130%;
  font-family: sans-serif;

.container {
  display: flex;  
  border: 5px solid black;
  padding: 0.25rem;

.container p {
  margin: 0.25rem;
  padding: 0.5rem;
  border: 5px dotted black;

fieldset {
  border: darkgrey 1px solid;
  padding: 0;
  margin-bottom: 2em; 

label {
  display: inline-block;
  padding: 0.5em;
  cursor: pointer;

.active {
  background: lightgrey;


                var radios = document.querySelectorAll('.radio');
var container = document.getElementById('container');
    i.addEventListener('click', function(el){
        var clicked = el.currentTarget;
        var active = clicked.parentElement.parentElement.querySelector('.active');
        active && active.classList.remove('active');
        container.className = 'container '+clicked.value;