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="demo">
  <div role="tabpanel">

  <!-- Nav tabs -->
  <ul class="nav nav-tabs nav-justified nav-tabs-dropdown" role="tablist">
    <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">HOME</a></li>
    <li role="presentation"><a href="#about" aria-controls="about" role="tab" data-toggle="tab">ABOUT US</a></li>
    <li role="presentation"><a href="#products" aria-controls="products" role="tab" data-toggle="tab">PRODUCTS</a></li>
 <li role="presentation"><a href="#services" aria-controls="pservices" role="tab" data-toggle="tab">SERVICES</a></li>
        <li role="presentation" class=""><a href="#projects" aria-controls="projects" role="tab" data-toggle="tab">GALLERY</a></li>
    <li role="presentation"><a href="#resources" aria-controls="services" role="tab" data-a-controls="resources" role="tab" data-toggle="tab">RESOURCES</a></li>
    <li role="presentation"><a href="#contact" aria-controls="contact" role="tab" data-toggle="tab">CONTACT US</a></li>

  </ul>

  <!-- Tab panes -->
  <div class="tab-content">
    <div role="tabpanel" class="tab-pane active" id="home">This is the home tab. Reduce the viewport to see the mobile tab dropdown</div>
    <div role="tabpanel" class="tab-pane" id="about">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae doloremque adipisci perferendis iste neque totam autem quam ratione odio culpa ex consectetur sit, facere sed, asperiores, deleniti dicta magnam ad. </div>
    <div role="tabpanel" class="tab-pane" id="products">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae doloremque adipisci perferendis iste neque totam autem quam ratione odio culpa ex consectetur sit, facere sed, asperiores, deleniti dicta magnam ad.</div>
    <div role="tabpanel" class="tab-pane" id="services">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae doloremque adipisci perferendis iste neque totam autem quam ratione odio culpa ex consectetur sit, facere sed, asperiores, deleniti dicta magnam ad.</div>
        <div role="tabpanel" class="tab-pane" id="projects">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae doloremque adipisci perferendis iste neque totam autem quam ratione odio culpa ex consectetur sit, facere sed, asperiores, deleniti dicta magnam ad.</div>
    <div role="tabpanel" class="tab-pane" id="resources">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae doloremque adipisci perferendis iste neque totam autem quam ratione odio culpa ex consectetur sit, facere sed, asperiores, deleniti dicta magnam ad.</div>
    <div role="tabpanel" class="tab-pane" id="contact">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae doloremque adipisci perferendis iste neque totam autem quam ratione odio culpa ex consectetur sit, facere sed, asperiores, deleniti dicta magnam ad.</div>
  </div>
 </div>
</div>



              
            
!

CSS

              
                .demo {
  padding: 30px;
  min-height: 280px;
}

.tab-content{
  padding: 10px;
}

@nav-link-hover-bg: #eeeeee;
@nav-tabs-border-color: #dddddd;
@border-radius-base: 5px;
@screen-xs-max: 767px;


//css to add hamburger and create dropdown
.nav-tabs.nav-tabs-dropdown,
.nav-tabs-dropdown {
 @media (max-width: @screen-xs-max) {
      border: 1px solid @nav-tabs-border-color;
      border-radius: @border-radius-base;
      overflow: hidden;
      position: relative;

      &::after {
        content: "☰";
        position: absolute;
        top: 8px;
        right: 15px;
        z-index: 2;
        pointer-events: none;
      }

      &.open {
        a {
          position: relative;
          display: block;
        }

        > li.active > a {
          background-color: @nav-link-hover-bg;
        }
      }


    li {
      display: block;
      padding: 0;
      vertical-align: bottom;
    }

    > li > a {
      position: absolute;
      top: 0;
      left: 0;
      margin: 0;
      width: 100%;
      height: 100%;
      display: inline-block;
      border-color: transparent;

      &:focus,
      &:hover,
      &:active {
        border-color: transparent;
      }
    }

    > li.active > a {
      display:block;
      border-color: transparent;
      position: relative;
      z-index: 1;
      background: #fff;

      &:focus,
      &:hover,
      &:active {
        border-color: transparent;
      }
       
    }
  }
}
              
            
!

JS

              
                //open and close tab menu
$('.nav-tabs-dropdown')
    .on("click", "li:not('.active') a", function(event) {  $(this).closest('ul').removeClass("open");
    })
    .on("click", "li.active a", function(event) {        $(this).closest('ul').toggleClass("open");
    });
              
            
!
999px

Console