Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

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

              
                <div class="product-tabs">
<ul class="tabs">
  <li data-tab="description" class="selected">Description</li>
  <li data-tab="details">Details</li>
  <li data-tab="returnPolicy">Return Policy</li>  
</ul>
<div class="tab-content selected" data-tab="description">
  <p> Description goes here </p>
</div>
<div class="tab-content" data-tab="details">
  <p> Details goes here </p>
</div>
<div class="tab-content" data-tab="returnPolicy">
  <p> Return Policy goes here </p>
</div>
</div>

<div class="bazaar-tabs">
<ul class="tabs">
  <li data-tab="ratings" class="selected">Ratings and Reviews</li>
  <li data-tab="questions">Questions and Answers</li>  
</ul>
<div class="tab-content selected" data-tab="ratings">
  <p> Ratings and Reviews go here </p>
</div>
<div class="tab-content" data-tab="questions">
  <p> Questions and answers go here </p>
</div>
</div>

              
            
!

CSS

              
                body {
  color: #333;
  font-family: sans-serif;
  padding: 1em;
}

.tabs {
  margin: 0;
  padding: 0;
}

.tabs li {
  display: inline-block;
  padding: 10px 10px 10px;
  background: white;
  border-color: #000;
  border-style: solid solid none solid;
  border-width: 1px;
  vertical-align: bottom;
  color: #aeaeae;  
  margin-left: -6px;
  cursor: pointer;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

.tabs li.selected {
  background: white;
  position: relative;
  border-color: #000;
  padding-bottom: 10px;
  padding-top: 11px;
  top: 1px;
  color: #565656;
}

.tab-content {
  background: white;
  padding: 20px 10px;
  border: solid #000 1px;
  margin-left: -6px;
  display: none;
  margin-bottom: 20px;
}

.tab-content.selected {
  display:block;
}

/* Tabs render differently in webkit vs other browsers */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  .tab-content {
    margin-left: -5px;
  }
  .tabs li {
    margin-left: -5px;
  }
}
              
            
!

JS

              
                jQuery(document).ready(function() {
  
  //Tabs functionality, specific for each tab to avoid conflict
  jQuery(".product-tabs .tabs li").on("click", function() {
    var tabToShow = jQuery(this).data('tab');
    jQuery(".product-tabs li.selected").removeClass("selected");  
    jQuery(this).addClass("selected");    
    jQuery('.product-tabs .tab-content').each(function(){
				if(jQuery(this).data('tab') === tabToShow){
					jQuery(this).addClass('selected');
				} else {
					jQuery(this).removeClass('selected');
				}
		});    
  });
  
  jQuery(".bazaar-tabs .tabs li").on("click", function() {
    var tabToShow = jQuery(this).data('tab');
    jQuery(".bazaar-tabs li.selected").removeClass("selected");  
    jQuery(this).addClass("selected");    
    jQuery('.bazaar-tabs .tab-content').each(function(){
				if(jQuery(this).data('tab') === tabToShow){
					jQuery(this).addClass('selected');
				} else {
					jQuery(this).removeClass('selected');
				}
		});    
  });
  
});
              
            
!
999px

Console