cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-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.

            
              <section class="accordion">
  <div class="tab tab-one">
    <label for="tab-one" class="tab-control-label">Tab One</label>
    <input type="radio" name="tab-radio" id="tab-one" class="tab-control-radio" checked>    
    <span class="indicator"></span>
    <div class="tab-content">
      <p>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Omnis labore repellendus ab fugit quos nesciunt impedit perspiciatis nemo quaerat fugiat, eos tenetur inventore officia illo atque dolores vel deleniti rem.
      </p>    
  </div>
  <div class="tab tab-two">
    <label for="tab-two" class="tab-control-label">Tab Two</label>   
    <input type="radio" name="tab-radio" id="tab-two" class="tab-control-radio">
    <span class="indicator"></span>
    <div class="tab-content">
      <p>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Omnis labore repellendus ab fugit quos nesciunt impedit perspiciatis nemo quaerat fugiat, eos tenetur inventore officia illo atque dolores vel deleniti rem.
      </p>
    </div> 
  </div>
  <div class="tab tab-three">
    <label for="tab-three" class="tab-control-label">Tab Three</label>
    <input type="radio" name="tab-radio" id="tab-three" class="tab-control-radio">
    <span class="indicator"></span>
    <div class="tab-content">
      <p>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Omnis labore repellendus ab fugit quos nesciunt impedit perspiciatis nemo quaerat fugiat, eos tenetur inventore officia illo atque dolores vel deleniti rem.
      </p>
    </div>
  </div>
</section>
            
          
!
            
              @import "compass/css3";

// Import Google font
@import url(https://fonts.googleapis.com/css?family=Roboto);

// Variables
$color1: #000;                  // Black
$color2: #FFF;                  // White
$color3: #171717;               // Green
$color4: darken($color3, 10%);  // Dark Green
$color5: lighten($color3, 60%); // Light Green

$font: 'Roboto', sans-serif;

// SASS Helpers

// Visually hide content, but keep it accessible by screenreaders
%visuallyhidden {
  position: absolute; 
  overflow: hidden; 
  clip: rect(0 0 0 0); 
  height: 1px; width: 1px; 
  margin: -1px; padding: 0; border: 0; 
}

body {
  background: transparent url('https://ununsplash.imgix.net/reserve/JaI1BywIT5Or8Jfmci1E_zakopane.jpg?dpr=2&fit=crop&fm=jpg&h=700&q=75&w=1050') center center no-repeat;
  font-family: $font;
}

.accordion {
  @include box-shadow(0 0 6px rgba($color1, 0.8));
  margin: 30px auto 0;
  width: 50%;
}

.tab {
  position: relative;
}

.tab-control-label {
  background-color: $color3;
  border-bottom: 2px solid $color5;
  color: $color2;
  cursor: pointer;
  display: block;
  font-weight: bold;
  margin: 0;
  padding: 10px 0 10px 20px;  
  text-transform: uppercase;
}

.tab-control-radio {
  @extend %visuallyhidden;
   
  & ~ .tab-content {    
    @include transition-property(max-height);
    @include transition-duration(.2s);
    @include transition-timing-function(ease-in);
    max-height: 0;  
    overflow: hidden;
  }
  
  &:checked ~ .tab-content {
    max-height: 100px;
  }
  
  &:checked ~ .indicator:after {
    content: '-';
    font-size: 60px;
    right: 20px;
    top: 16px;
  }
}

.indicator:after {
  color: $color2;
  content: '+';
  font-size: 40px;
  line-height: 0;
  right: 17px;
  position: absolute;
  top: 20px;
}

.tab-content {
  background-color: $color2;
  
  p {
    margin: 20px;
  }
}
            
          
!
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