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

              
                <div id="tabs">
  <ul id="tabs-nav">
    <li><a href="#tab1">Tab 1</a></li>
    <li><a href="#tab2">Tab 2</a></li>
    <li><a href="#tab3">Tab 3</a></li>
  </ul> <!-- tabs-nav -->
  
  <div id="tabs-content">
    <div id="tab1" class="content">
      <h2>First</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptate laboriosam libero quis maiores hic explicabo distinctio nesciunt alias! Distinctio ratione eligendi delectus natus accusamus iste laborum omnis qui eius quas.</p>
    </div>
    <div id="tab2" class="content">
      <h2>Second</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ex soluta commodi velit similique quo officiis nulla aspernatur enim earum expedita ad sequi est harum laboriosam aperiam facilis aliquam perferendis. Voluptate.</p>
    </div>
    <div id="tab3" class="content">
      <h2>Third</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quas sunt doloribus perspiciatis a cum alias adipisci laboriosam quibusdam ipsum eius veritatis asperiores labore quo hic assumenda laudantium excepturi repellendus ullam.</p>
    </div>
  </div> <!-- tabs-content -->
</div> <!-- Tabs -->
              
            
!

CSS

              
                body {
  margin: 0;
  padding: 0;
  font: 1em Arial,sans-serif;
}
a {
  text-decoration: none;
}

/* Tabs */
#tabs {
  width: 600px;
  margin: 5em auto;
}

#tabs-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #ccc;
  overflow: auto;
}

#tabs-nav li {
    float: left;
    font-size: 14px;
    font-weight:bold;
    margin-right: 6px;
    padding:6px 10px;
    border:1px solid #d5d5de;
    border-bottom:none;
    cursor:pointer;
  }
#tabs-nav li:hover,
li.active {
  background-color: #d5d5de;
}

.content {
  padding: 10px;
  border: 1px solid #d5d5de;
  border-top: none;
}
              
            
!

JS

              
                // show first content by default
$('#tabs-nav li:first-child').addClass('active');
$('.content').hide();
$('.content:first').show();

// click function
$('#tabs-nav li').click(function(){
  $('#tabs-nav li').removeClass('active');
  $(this).addClass('active');
  $('.content').hide();
  
  var activeTab = $(this).find('a').attr('href');
  $(activeTab).fadeIn();
  return false;
  
});



              
            
!
999px

Console