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 class="sizeM">
  <input type="radio" id="one" name="offer" />
  <label for="one">Bonus Offer 1</label>
  <div class="content">
    <p>
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vitae sem non metus suscipit placerat. Sed blandit velit in consequat ullamcorper. Vivamus lorem diam, egestas adipiscing massa ac, ultrices blandit est. Aliquam eu nunc ut ipsum semper ullamcorper sed in ipsum. In commodo iaculis orci at fringilla. Integer et magna at lorem tristique aliquet in sed leo. Mauris venenatis nibh felis, eu viverra nunc molestie nec. Curabitur ultricies risus ut dui facilisis mattis. Suspendisse sagittis ut lectus nec egestas.
    </p>
  </div>
</fieldset>
<fieldset class="sizeM">
  <input type="radio" id="two" name="offer" />
  <label for="two">Second Bonus Offer</label>
  <div class="content">
    <p>
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vitae sem non metus suscipit placerat. Sed blandit velit in consequat ullamcorper. Vivamus lorem diam, egestas adipiscing massa ac, ultrices blandit est. Aliquam eu nunc ut ipsum semper ullamcorper sed in ipsum. In commodo iaculis orci at fringilla. Integer et magna at lorem tristique aliquet in sed leo. Mauris venenatis nibh felis, eu viverra nunc molestie nec. Curabitur ultricies risus ut dui facilisis mattis. Suspendisse sagittis ut lectus nec egestas.
    </p>
  </div>
</fieldset>
<fieldset class="sizeM">
  <input type="radio" id="three" name="offer" />
  <label for="three">Third Bonus Offer</label>
  <div class="content">
    <p>
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vitae sem non metus suscipit placerat. Sed blandit velit in consequat ullamcorper. Vivamus lorem diam, egestas adipiscing massa ac, ultrices blandit est. Aliquam eu nunc ut ipsum semper ullamcorper sed in ipsum. In commodo iaculis orci at fringilla. Integer et magna at lorem tristique aliquet in sed leo. Mauris venenatis nibh felis, eu viverra nunc molestie nec. Curabitur ultricies risus ut dui facilisis mattis. Suspendisse sagittis ut lectus nec egestas.
    </p>
  </div>
</fieldset>
<fieldset class="no sizeM">
  <input type="radio" id="four" name="offer" />
  <label for="four">No Thanks</label>
</fieldset>
              
            
!

CSS

              
                fieldset {
  border: 0;
  margin: 0 0 1px 0;
  width: 50%;
  -webkit-transition: background 0.1s linear;
}

fieldset label {
  color: #111;
  cursor: pointer;
  display: inline-block;
  font-family: arial, sans-serif;
  line-height: 18px;
  text-transform: uppercase;
  vertical-align: middle;
  -webkit-transition: padding 0.1s linear, font-size 0.1s linear;
  -webkit-transition-delay: 0.1s;
}

input[type=radio] { 
  visibility: hidden;
}

label:before {
  border-radius: 8px; 
  content: '';  
  display: inline-block;  
  width: 16px;  
  height: 16px;
  margin-right: 10px;
  background-color: #f9f9f9;  
  box-shadow: inset 0 2px 3px 0 rgba(0, 0, 0, .3), 0 1px 0 0 rgba(255, 255, 255, .8);  
}

input[type=radio]:checked + label:before {  
  content: "\2022";  
  color: #000;  
  font-size: 30px;
  line-height: 19px;
  text-align: center;
}  

input[type=radio]:checked ~ .content {
  height: 140px;
}

fieldset .content {
  height: 0;
  overflow: hidden;
  -webkit-transition: height 0.1s linear;
}

fieldset .content p {
  color: #111;
  font-family: arial, sans-serif;
  font-size: 16px;
  line-height: 24px;
  padding: 0 40px 40px 0;
}

.sizeS { background: #eee; }
.sizeM { background: #111; }
.sizeL { background: yellow; }
.sizeS label { font-size: 10px; padding: 5px 0; }
.sizeM label { color: #fff; font-size: 16px; padding: 15px 0; }
.sizeL label { font-size: 24px; }
              
            
!

JS

              
                $(function() {
  
  $('fieldset label').on('click', function() {  
    $('fieldset').removeClass('sizeM sizeL').addClass('sizeS');
    $(this).parent().addClass('sizeL')
  });
  
  $('.no label').on('click', function() {
    $('fieldset').removeClass('sizeS sizeL').addClass('sizeM');
    $(this).parent().removeClass('sizeL').addClass('sizeM')
  });
                         
});
              
            
!
999px

Console