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 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="navbar navbar-inverse navbar-static-top">
      <div class="container">
        <div class="navbar-header">
          <a class="navbar-brand" href="#">Responsive Tabs</a>
        </div>
      </div>
    </div>

    <div class="container">
	<h1>Responsive Tab</h1>
    <h2>Tabs with an assigned <code>id</code>.</h2>
      <ol>
          <li>First tab initialized as active.</li>
          <li>First and third tab have a <code>deco-none</code> class and the first has an additional <code>red-class</code> that are copied to the anchor tags in the accordions.</li>
      </ol>
      <br>
      <ul class="nav nav-tabs responsive" id="myTab">
        <li class="active"><a class="deco-none red-class" href="#resp-tab1"><span class="glyphicon glyphicon-cog"></span> Tab 1</a></li>
        <li><a href="#resp-tab2"><span class="glyphicon glyphicon-headphones"></span> Tab 2</a></li>
        <li><a class="deco-none" href="#resp-tab3"><span class="glyphicon glyphicon-folder-open"></span> Tab 3</a></li>
      </ul>

      <div class="tab-content responsive">
        <div class="tab-pane active" id="resp-tab1">Tab 1 ... Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eu posuere tortor. Phasellus consectetur aliquet risus, in lacinia erat ullamcorper a. Suspendisse molestie porta metus, at cursus elit. Quisque et neque nec velit tincidunt fringilla. <button class='btn btn-primary js-alert-test'>Test Event Maintained</button></div>
        <div class="tab-pane" id="resp-tab2">Tab 2 ... Phasellus consectetur aliquet risus, in lacinia erat ullamcorper a. Suspendisse molestie porta metus, at cursus elit. Quisque et neque nec velit tincidunt fringilla. Morbi eget nisi molestie, egestas turpis non, pharetra orci. Donec mattis sem ipsum, eu dapibus lacus rutrum in. Fusce blandit mi leo, non feugiat nunc tempus vitae.</div>
        <div class="tab-pane" id="resp-tab3">Tab 3 ... Quisque et neque nec velit tincidunt fringilla. Morbi eget nisi molestie, egestas turpis non, pharetra orci. Donec mattis sem ipsum, eu dapibus lacus rutrum in. Fusce blandit mi leo, non feugiat nunc tempus vitae. Mauris hendrerit, leo sit amet mollis bibendum, lacus augue auctor turpis, sed placerat augue libero quis massa.</div>
      </div>
    </div> <!-- /container -->
              
            
!

CSS

              
                <style type="text/css">
      .deco-none {
        text-decoration: none !important;
      }
      .red-class {
          color: red !important;
      }
    </style>
              
            
!

JS

              
                $( 'ul.nav.nav-tabs  a' ).click( function ( e ) {
        e.preventDefault();
        $( this ).tab( 'show' );
      } );

      ( function( $ ) {
          // Test for making sure event are maintained
          $( '.js-alert-test' ).click( function () {
            alert( 'Button Clicked: Event was maintained' );
          } );
          fakewaffle.responsiveTabs( [ 'xs', 'sm' ] );
      } )( jQuery );
              
            
!
999px

Console