Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <ul class="tab-container">
  <li>
    <input class="tab-toggle" id="tab-1" type="radio" name="toggle" checked /> 
    <label data-title="Tab 1" class="tab l-b" for="tab-1">Tab 1</label>            
    <ul class="tab-content-container">
      <li class="tab-content">
        This is a testing text to test the tab content container. Lorem Ipsum dolor sit amet! Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
        This is a testing text to test the tab content container. Lorem Ipsum dolor sit amet! 
        <div class="arrows">
          <label class="back" for="tab-4">&#8249;</label>
          <label class="next" for="tab-2">&#8250;	</label>   
        </div>
      </li>
    </ul>
  </li>
  <li>
    <input class="tab-toggle" id="tab-2" type="radio" name="toggle" />
    <label class="tab" for="tab-2">Tab 2</label> 
    <ul class="tab-content-container">
      <li class="tab-content">
        Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
        Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
        <div class="arrows">
          <label class="back" for="tab-1">&#8249;</label>
          <label class="next" for="tab-3">&#8250;	</label>   
        </div>   
      </li>
    </ul>
  </li>
  <li>
    <input class="tab-toggle" id="tab-3" type="radio" name="toggle"/>        
    <label class="tab" for="tab-3">Tab 3</label> 
    <ul class="tab-content-container">
      <li class="tab-content">
        Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
        Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
        <div class="arrows">
          <label class="back" for="tab-2">&#8249;</label>
          <label class="next" for="tab-4">&#8250;	</label>   
        </div>
      </li>
    </ul>    
  </li>
  <li>
    <input class="tab-toggle" id="tab-4" type="radio" name="toggle"/>     
    <label class="tab" for="tab-4">Tab 4</label> 
    <ul class="tab-content-container">
      <li class="tab-content">
        This is the final content for the tab example.
        <div class="arrows">
          <label class="back" for="tab-3">&#8249;</label>
          <label class="next" for="tab-1">&#8250;	</label>   
        </div>
      </li>  
    </ul>  
  </li>
</ul>

              
            
!

CSS

              
                *, *:before, *:after { box-sizing: border-box; }
html { margin: 0; font-family: arial; height: 100vh; background: #ccc; }

.tab-container {
  list-style-type: none;
  padding: 0;
  margin: 60px auto;
  max-width: 350px;
  position: relative;
  background: #fff;
  ul { list-style-type: none; padding: 0; }
  .arrows { 
    display: block;
    width: 60px;
    font-size: 32px;    
    bottom: 10px;
    right: 0px;
    position: absolute;
    label { 
      display: inline-block; 
      cursor: pointer; 
      color: #aaa; 
      -webkit-user-select: none;
      -moz-user-select: none;    
      -ms-user-select: none;     
      user-select: none;  
      margin-left: 5px;      
      &:hover { color: #333; }
    }
  }
  .tab-content-container { 
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px; 
    height: 0; 
    opacity: 0; 
    overflow: hidden; 
    line-height: 22px;
    background: #fff;
    position: absolute;
    top: 42px;
    padding: 0px 40px 0 20px;
    border: 2px solid #446CB3;
    border-top: 0;
    box-shadow: 0 5px 5px -5px #333;  
    .tab-content {
      opacity: 0;
      padding: 15px 0;
      min-height: 185px;  
      transition: opacity 0.1s ease-in;    
    }
  }
  .tab {
    outline: 0;
    float: left;
    cursor: pointer;    
    opacity: 1;
    width: 25%;
    line-height: 40px;
    display: block;
    margin: 0;
    position: relative;
    background: #446CB3;
    color: #fff;
    text-align: center;    
    border-top: 2px solid #446CB3;
    border-right: 2px solid #446CB3;
    &.l-b { border-left: 2px solid #446CB3; }
    &:hover { background: #365690; }          
  }
  .tab-toggle {
    display: none;
    &.active + .tab,
    &:checked + .tab { 
      background: #fff; 
      color: #333; 
    }
    &.active ~ .tab-content-container,
    &:checked ~ .tab-content-container { 
      height: auto;
      opacity: 1;
      .tab-content { 
        opacity: 1; 
        label { opacity: 1; }
      }
    }
  }
}
              
            
!

JS

              
                // Optional jQuery class toggle for added robustness. 

/* 
var labelID;

$('label').click(function() {
  labelID = $(this).attr('for');
  $('input').removeClass('active');
  $('#' + labelID).addClass('active');
}); 
*/
              
            
!
999px

Console