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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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="tabs">
  <ul class="tab-links">
    <li class="active"><a href="#tab1">Tab 1</a></li>
    <li><a href="#tab2">Tab 2</a></li>
    <li><a href="#tab3">Tab 3</a></li>
    <li><a href="#tab4">Tab 4</a></li>
  </ul>
  <div class="tab-content">
    <div id="tab1" class="tab active">
      <h3>Tab 1 Title</h3>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Obcaecati, eius. Aperiam minus modi aliquam beatae illum ducimus laudantium impedit rerum, quasi, laborum itaque dicta, nostrum, deserunt? Excepturi animi, dolor id.</p>
        
     </div>
     <div id="tab2" class="tab">
       <h3>Tab 2 Title</h3>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sequi reiciendis quasi accusantium nesciunt, sunt, id obcaecati consequuntur sed perferendis qui cupiditate dolor tempora dicta, illum recusandae necessitatibus nostrum facere delectus.</p>
       <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Optio reprehenderit rem velit nesciunt, recusandae pariatur officia, aperiam, vel quaerat voluptas magni natus repudiandae in at dolore distinctio nemo quis iure!</p>
       
    </div>
    <div id="tab3" class="tab">
      <h3>Tab 3 Title</h3>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptates, maxime iste adipisci rerum quia! Officiis quaerat quasi repellendus facilis ipsam debitis quod, accusamus nemo! Corporis odio ab repellat unde. Perferendis.</p>    
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quasi laudantium beatae voluptas dolor, illo maxime fuga labore facilis autem voluptatibus molestiae? Dicta eaque error, vel qui. Iure repellendus saepe assumenda!</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolor recusandae facere ratione magnam vel iusto labore quaerat quia autem placeat esse debitis voluptates nisi, sint quibusdam nesciunt a. Ipsa, similique.</p>
    </div>
    <div id="tab4" class="tab">
      <h3>Tab 4 Title</h3>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corporis dignissimos similique hic minima ullam repudiandae aperiam est consectetur ea maxime assumenda eligendi, placeat aliquam. Saepe ipsa optio nemo animi. Tempore!</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dignissimos, illum fugiat obcaecati laudantium consequuntur qui veritatis, quibusdam harum architecto repellat dolor vitae quidem et quia delectus nostrum numquam ipsam suscipit?</p>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dicta dolorem maxime, perspiciatis fugit. Fugiat necessitatibus a veniam eaque nobis, delectus officia saepe. Eveniet, eum, voluptatem. Labore totam ad ea fugit!</p>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Velit quasi labore mollitia perferendis quia fugit praesentium aspernatur necessitatibus natus molestias dolores eos unde maiores, accusamus asperiores ab iusto sapiente recusandae!</p>
        
    </div>
    
  
</div>
              
            
!

CSS

              
                /*

http://inspirationalpixels.com/tutorials/creating-tabs-with-html-css-and-jquery

*/
body{
  background-color: #00598f;
}

/*----- Tabs -----*/
.tabs {
    width:100%;
    display:inline-block;
}
 
    /*----- Tab Links -----*/
    .tab-links{
      margin-bottom: 0px;
      padding-left: 0px;
    }
    /* Clearfix */
    .tab-links:after {
        display:block;
        clear:both;
        content:'';
    }
 
    .tab-links li {
        margin:0px 5px;
        float:left;
        list-style:none;
    }
 
        .tab-links a {
            padding:9px 15px;
            display:inline-block;
            border-radius:3px 3px 0px 0px;
            background:#7FB5DA;
            font-size:16px;
            font-weight:600;
            color:#4c4c4c;
            transition:all linear 0.15s;
        }
 
        .tab-links a:hover {
            background:#a7cce5;
            text-decoration:none;
        }
 
    li.active a, li.active a:hover {
        background:#fff;
        color:#4c4c4c;
    }
 
    /*----- Content of Tabs -----*/
    .tab-content {
        padding:15px;
        border-radius:3px;
        box-shadow:-1px 1px 1px rgba(0,0,0,0.15);
        background:#fff;
        
    }
 
        .tab {
            display:none;
        }
 
        .tab.active {
            display:block;
        }
              
            
!

JS

              
                $(".tabs .tab-links a").on("click", function(event){
  event.preventDefault();
  //Grab the href attribute from whichever link was clicked
  var tabID = $(this).attr("href");
  
 /* $(".tabs .tab").removeClass("active");
  $(".tabs " + tabID).addClass("active"); //i.e. $(".tabs *tab4")*/
  
  //Show the curerent tab and hide all the others
  //$(".tabs " + tabID).addClass("active").siblings().removeClass("active");
  
  //Highlight the active tab  
    $(this).parent("li").addClass("active").siblings().removeClass("active");
   
  //Show the current tab without using CSS
  //  $(".tabs " + tabID).show().siblings().hide();
  
  //Fade in the new page
 //   $(".tabs " + tabID).fadeIn(500).siblings().hide();
  
  //Slide off old content, then slide on new content
      $(".tabs " + tabID).siblings().slideUp(400);
      $(".tabs " + tabID).delay(400).slideDown(400);
	//	$("#"+tab_id).addClass('current');
  

});
              
            
!
999px

Console