css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div data-tabs class="tabs">    
   <div class="tab">
      <input type="radio" name="tabgroup" id="tab-1" checked>
      <label for="tab-1">Tab 1</label>
      <div class="tab__content">
         <h4>Tab heading 1</h4>
         <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Incidunt libero ipsum, veniam magni modi exercitationem debitis ducimus assumenda ratione corporis, illum eius, laborum tempore cumque amet id perspiciatis nostrum unde?</p>
         <p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Ipsum, maiores.</p>
      </div> 
   </div>
   <div class="tab">
      <input type="radio" name="tabgroup" id="tab-2">
      <label for="tab-2">Tab 2</label>
      <div class="tab__content">
         <h4>Tab heading 2</h4>
         <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Consectetur odio cum eveniet excepturi eum provident molestias ad ipsa unde dignissimos illo porro animi earum aliquam perspiciatis id omnis, adipisci incidunt. Qui, beatae. Beatae animi totam obcaecati at quae, iste facere fuga nemo pariatur esse nihil?</p>
         <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Doloremque commodi eos voluptatem numquam pariatur deleniti repellat fugiat eligendi nulla molestiae sunt praesentium vero sequi distinctio error quibusdam maiores natus magnam, explicabo hic sed alias dolores, quis eum! Reprehenderit atque cupiditate dolorum? Saepe, doloribus veniam? Nulla!</p>
      </div> 
   </div>
   <div class="tab">
      <input type="radio" name="tabgroup" id="tab-3">
      <label for="tab-3">Tab 3</label>
      <div class="tab__content">
         <h4>Tab heading 3</h4>
         <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Laboriosam officiis voluptas maiores deserunt ullam aliquam?</p>
         <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Accusamus, officia accusantium quod fuga porro eius animi earum excepturi omnis! Reprehenderit!</p>
      </div> 
   </div>
   <div class="tab">
      <input type="radio" name="tabgroup" id="tab-4">
      <label for="tab-4">Tab 4</label>
      <div class="tab__content">
         <h4>Tab heading 4</h4>
         <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Officia exercitationem veritatis vero eaque. Nam totam dolorem sapiente ullam non sed nostrum praesentium voluptatem, ad quam libero deserunt nemo fuga hic repudiandae veritatis cupiditate, mollitia recusandae!</p>
      </div> 
   </div>
</div>
            
          
!
            
              @import url('https://fonts.googleapis.com/css?family=Open+Sans');

body {
   font-family: 'Open Sans', sans-serif;
   background-color: #C2EABA;
   padding-top: 50px;
   line-height: 1.4;
   font-size: 1.4em;
}

.tabs {
	clear: both;
	position: relative;   
   max-width: 650px;
   margin: 0 auto;
   /* you can either manually set a min-height here or do it via JS ---> */
}

.tab {
	float: left;
}

.tab label {
	margin-right: 20px;
	position: relative;
	top: 0;
	cursor: pointer;
	color: #333;
   text-transform: uppercase;
}

.tab [type=radio] {
	display: none;   
}

.tab__content {
   position: relative;
	top: 40px;
	left: 0;
	right: 0;
	bottom: 0;
	transition: opacity .2s cubic-bezier(.42,0,.34,1.01);
	opacity: 0;
}

[type=radio]:checked ~ label {
	border-bottom: 2px solid #1d1d1d;
	color: #1d1d1d;
	z-index: 2;
}

[type=radio]:checked ~ label ~ .tab__content {
	z-index: 1;
	opacity: 1;
}
            
          
!
            
              (function($, document) {
    
      // get tallest tab__content element
      let height = -1;

		$('.tab__content').each(function() {
			height = height > $(this).outerHeight() ? height : $(this).outerHeight();
         $(this).css('position', 'absolute');
		});
      
      // set height of tabs + top offset
		$('[data-tabs]').css('min-height', height + 40 + 'px');
   
}(jQuery, document));
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console