cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <form>
  <fieldset class="radioset">
    <ul>
      <li><input type="radio" name="radio[]" id="radio1" checked><label for="radio1">foo</label>
      <li><input type="radio" name="radio[]" id="radio2"><label for="radio2">bar</label>
      <li><input type="radio" name="radio[]" id="radio3"><label for="radio3">baz</label>
      <li><input type="radio" name="radio[]" id="radio4"><label for="radio4">qux</label>
    </ul>
  </fieldset>
</form>
            
          
!
            
              @import "compass/css3";

* {
  -webkit-box-sizing: border-box;
  font-family: sans-serif;
}

body {
  background: #eee;
  margin: 2em;
}

.radioset {
  border: 0;
  border-radius: .5em;
  background: #f0f0f0 linear-gradient( #fefefe, #f5f5f5 25%, #f0f0f0 75%, #ddd  );
  box-shadow: 0 3px 15px -5px;
  min-width: 16em;
  max-width: 30em;
  margin: auto;
  
  ul {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;
    position: relative;

    &::before {
      content: '';
      position: absolute;
      top: 60%;
      left: 12.5%;
      right: 12.5%;
      height: 6px;
      margin-top: -3px;
      background: #CCC;
      box-shadow: inset 0 3px 5px -4px #000, 0 1px #fff;
    }
  }

  li {
    display: inline-block;
    position: relative;
    width: 25%;
  }

  [type="radio"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  }

  label {
    line-height: 30px;
    padding-bottom: 40px;
    display: block;
    color: #789;
    text-shadow: 0 1px #fff, 0 -1px #eee;
    font-variant: small-caps;

    &::before,
    &::after {
      content: '';
      position: absolute;
      left: 50%;
      top: 60%;
      border-radius: 50%;
      transform: translate3d(0,0,0);
      @include transition( .35s cubic-bezier( 0.175, 0.885, 0.320, 1.275 ) all ); // inspired by Ladda by hakim.se
    }

    &::before {      
      width: 20px;
      height: 20px;
      margin: -10px 0 0 -10px;
      border: 0 solid #CCC;
      background: #CCC;
      
      transform: scale( 0.7 );
      box-shadow: inset 0 3px 5px -4px #000, 0 2px 1px -1px #fff;
    }

    &::after {
      width: 10px;
      height: 10px;
      margin: -5px 0 0 -5px;
      background: #fff;
      
      transform: scale( 0 );
      opacity: 0;
    }
  }

  :checked {
    + label {      
      &::before,
      &::after {
        @include transition( .4s cubic-bezier( 1, -1, 0.4, 1.4 ) all );
      }
      
      &::before {      
        transform: scale( 1 );
      }

      &::after {      
        transform: scale( 1 );
        opacity: 1;
        box-shadow: inset 0 -5px 5px -5px #ccc, 0 2px 5px -2px #000;
      }
    }
  }
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console