cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-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.

            
              <span class="dropdown-el">
    <input type="radio" name="sortType" value="Relevance" checked="checked" id="sort-relevance"><label for="sort-relevance">Relevance</label>
    <input type="radio" name="sortType" value="Popularity" id="sort-best"><label for="sort-best">Product Popularity</label>
    <input type="radio" name="sortType" value="PriceIncreasing" id="sort-low"><label for="sort-low">Price Low to High</label>
    <input type="radio" name="sortType" value="PriceDecreasing" id="sort-high"><label for="sort-high">Price High to Low</label>
    <input type="radio" name="sortType" value="ProductBrand" id="sort-brand"><label for="sort-brand">Product Brand</label>
    <input type="radio" name="sortType" value="ProductName" id="sort-name"><label for="sort-name">Product Name</label>
  </span>
            
          
!
            
              $color:#3694d7;
$timing:.3s;

body {
  text-align:center;
  background:mix($color,#fff,10%);
  min-height:95vh;
  margin:0;
  padding:0;
  border-bottom: 5vh solid $color;
  font-family: "Myriad Pro","Arial",sans;
  font-size:24px;
}
.dropdown-el {
  margin-top:20vh;
    
  min-width: 12em;
  position: relative;
  display: inline-block;
  margin-right: 1em;
  min-height: 2em;
  max-height:2em;
  overflow:hidden;
  top: .5em;  
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  color: #444;
  
  outline: none;
  border: .06em solid transparent;
  border-radius: 1em;
  background-color: mix($color,#fff,25%);
  
  transition: $timing all ease-in-out;  
  input {
    display:none;
  }
  label {
    border-top: .06em solid #d9d9d9;
    display:block;
    height: 2em;
    line-height: 2em;
    padding-left: 1em;
    padding-right: 3em;
    cursor: pointer;
    position: relative;
    transition: $timing color ease-in-out;  
    &:nth-child(2) {
      margin-top: 2em;
      border-top: .06em solid #d9d9d9;
    }
  }
  input:checked + label {
    display:block;
    border-top: none;
    position: absolute;
    top: 0;

    &:nth-child(2) {
      margin-top: 0;
      position: relative;
    }
  }
  
  &::after {
    content:"";
    position: absolute;
    right: 0.8em;
    top: 0.9em;
    border: .3em solid $color;
    border-color: $color transparent transparent transparent;
    transition: .4s all ease-in-out;
  }
  &.expanded {
    border: .06em solid $color;
    background: #fff;
    border-radius: .25em;
    padding: 0;
    box-shadow: rgba(0, 0, 0, 0.1) 3px 3px 5px 0px;
    max-height:15em;
    
    label {
      border-top: .06em solid #d9d9d9;
      &:hover {
        color:$color;
      }
    }
    input:checked + label {
      color:$color;
    }
    
    &::after {
      transform: rotate(-180deg);
      top:.55em;
    }
  }
}
            
          
!
            
              $('.dropdown-el').click(function(e) {
  e.preventDefault();
  e.stopPropagation();
  $(this).toggleClass('expanded');
  $('#'+$(e.target).attr('for')).prop('checked',true);
});
$(document).click(function() {
  $('.dropdown-el').removeClass('expanded');
});
            
          
!
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