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

              
                .container
  .tab-group
    section#tab1(title="Long Tab Name")
      h3 Content 1
      p Aliquam eleifend magna mauris, id egestas eros dictum ac. Vivamus ac turpis at nisi mattis aliquam. In hac habitasse platea dictumst. 
    section#tab2(title="Another Tab")
      h3 Content 2
      p Donec congue ligula non risus dictum, eget vehicula diam mattis. Pellentesque at ante ipsum. Suspendisse rutrum elementum dolor, non congue risus sagittis id.
    section#tab3(title="Tab 3")
      h3 Content 3
      p Vivamus sem odio, mattis vel dui aliquet, iaculis lacinia nibh. Vestibulum tincidunt, lacus vel semper pretium, nulla sapien blandit massa, et tempor turpis urna eu mi.
    section#tab4(title="Another Tab")
      h3 Content 4
      p Donec congue ligula non risus dictum, eget vehicula diam mattis. Pellentesque at ante ipsum. Suspendisse rutrum elementum dolor, non congue risus sagittis id.

    section#tab5(title="Another Tab")
      h3 Content 5
      p Donec congue ligula non risus dictum, eget vehicula diam mattis. Pellentesque at ante ipsum. Suspendisse rutrum elementum dolor, non congue risus sagittis id.

              
            
!

CSS

              
                @import "compass/css3";

/* =========
   Get Fonts */
@import url(https://fonts.googleapis.com/css?family=Quicksand);
@import url(https://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css);

/* ================
   Assign Variables */
$primary-color: #6EB590;
$secondary-color: #777;
$radius: 10px;
$border-width: 1px;

/* ===========================
   Setup Mixins/Helper Classes */
.clearfix:after {
    content: ".";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
}

/* ==========
   Setup Page */
*, *:before, *:after { box-sizing: border-box; }
body { padding: 3em; background-image: url(https://subtlepatterns.com/patterns/retina_wood.png); color: grey; font-family: 'Quicksand', sans-serif; }

/* =================
   Container Styling */
.container {
  position: relative;
  background: white;
  padding: 3em;
  border-radius: $radius;
  @extend .clearfix;
}

/* ===========
   Tab Styling */


.tab-group {
  position: relative;
  border: 1px solid #eee;
  margin-top: 2.5em;
  border-radius: 0 0 $radius $radius;
  section {
    opacity: 0;
    height: 0;
    padding: 0 1em;
    overflow: hidden;
    transition: opacity .4s ease, height .4s ease ;
  }
  section.active {
    opacity: 1;
    height: auto;
    overflow: visible;
  }
}

.tab-nav {
  list-style: none;
  margin: -2.5em -1px 0 0;
  padding: 0;
  @extend .clearfix;
  height: 2.5em;
  //background: #ff0;
  overflow: hidden;
  li {
    display: inline;
    a {
      top: 1px;
      position: relative;
      display: block;
      float: left;
      border-radius: $radius $radius 0 0;
      background: #eee;
      line-height: 2em;
      padding: 0 1em;
      text-decoration: none;
      color: grey;
      margin-top: .5em;
      margin-right: 1px;
      transition: background .2s ease, line-height .2s ease, margin .2s ease;
    }
    &.active a { 
      background: $primary-color; 
      color: white;
      line-height: 2.5em;
      margin-top: 0;
    }
  }
}


              
            
!

JS

              
                ;(function(defaults, $, window, document, undefined) {

	'use strict';

	$.extend({
		// Function to change the default properties of the plugin
		// Usage:
		// jQuery.tabifySetup({property:'Custom value'});
		tabifySetup : function(options) {

			return $.extend(defaults, options);
		}
	}).fn.extend({
		// Usage:
		// jQuery(selector).tabify({property:'value'});
		tabify : function(options) {

			options = $.extend({}, defaults, options);

			return $(this).each(function() {
        var $element, tabHTML, $tabs, $sections;
        
        $element = $(this);
        $sections = $element.children();
        
        // Build tabHTML
        tabHTML = '<ul class="tab-nav">';
        $sections.each(function() {
          if ($(this).attr("title") && $(this).attr("id")) {
            tabHTML += '<li><a href="#' + $(this).attr("id") + '">' + $(this).attr("title") + '</a></li>';
          }
        });
        tabHTML += '</ul>';
        
        // Prepend navigation
        $element.prepend(tabHTML);
        
        // Load tabs
        $tabs = $element.find('.tab-nav li');
        
        // Functions
        var activateTab = function(id) {
          $tabs.filter('.active').removeClass('active');
          $sections.filter('.active').removeClass('active');
          $tabs.has('a[href="' + id + '"]').addClass('active');
          $sections.filter(id).addClass('active');
        }
        
        // Setup events
        $tabs.on('click', function(e){
          activateTab($(this).find('a').attr('href'));
          e.preventDefault();
        });
        
        // Activate first tab
        activateTab($tabs.first().find('a').attr('href'));
        
			});
		}
	});
})({
	property : "value",
	otherProperty : "value"
}, jQuery, window, document);


// Calling the plugin
$('.tab-group').tabify();
              
            
!
999px

Console