123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="tab-block" id = "tab-block">
  
  <ul class="tab-mnu">
    <li class = "active" >About</li>
    <li>Team</li>
    <li>Privacy</li>
    <li>Advertise</li>
    <li>Contact</li>
  </ul>
  
  <div class="tab-cont">
    <div class="tab-pane"><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quam ex optio molestiae deleniti accusantium nobis hic, quia, quaerat ipsa numquam, eius expedita odit earum. Dolores dolore iusto est earum praesentium?</p></div>
    <div class="tab-pane"><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Unde, sit, velit mollitia pariatur laudantium officia, fugit neque eligendi saepe sint ea! Debitis aperiam nulla voluptatem libero fuga a, veniam amet.</p></div>
    <div class="tab-pane"><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi magnam porro iure fugiat repellendus iusto aperiam ducimus laudantium alias omnis maiores beatae veniam debitis voluptatibus asperiores, voluptates nostrum nihil quae?</p></div>
    <div class="tab-pane"><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aspernatur excepturi, amet voluptatibus quibusdam assumenda adipisci, quidem ipsa necessitatibus, fugit repellat nam sequi ducimus recusandae id illo? Unde necessitatibus repellat, modi?</p></div>
    <div class="tab-pane"><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur cupiditate dignissimos quae aspernatur, ex hic, voluptatibus excepturi officia velit dolorum fugiat nam nostrum earum maiores praesentium nemo nobis eaque officiis.</p></div>
  </div>

</div>
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Open+Sans:400);
$base-font: 'Open Sans', sans-serif;

$bgc:#4c607c;
$tabc:#b2bbc0;
$fontc:#596165;
$tabfontc:white;

$tabwidth:650px;


body{
  background-color: $bgc;
  height:100%;
  font-family: $base-font;
  font-size: 16px;
  line-height:1.5;
}

.tab-block{
  width:$tabwidth;
  height:290px;
  margin:50px auto;
  .tab-mnu{
    display:block;
    list-style:none;
    &:after{
      content:'';
      display:table;
      clear:both;
    }
    li{
      box-sizing:border-box;
      float:left;
      background-color: $tabc;
      color:$tabfontc;
      width:$tabwidth/5;
      text-align:center;
      padding-top:13px;
      padding-bottom:13px;
      cursor:pointer;
      &:not(:last-child){
        border-right:1px solid $bgc;
      }
      &:hover:not(.active){
        background-color: lighten($tabc,5%);
      }
    }
    .active{
        background-color: #fff;
        color:$fontc;
        border-bottom:1px solid lighten($fontc,55%);
      cursor:default;
      }
  }
  
  .tab-cont{
    box-sizing:border-box;
    border-top:1px solid white;
    background-color:$tabfontc;
    color:darken($fontc,20%);
    .tab-pane{
      padding:20px 25px;
    }
  }
    
}
            
          
!
            
              $(document).ready(function(){
  
  var tabWrapper = $('#tab-block'),
      tabMnu = tabWrapper.find('.tab-mnu  li'),
      tabContent = tabWrapper.find('.tab-cont > .tab-pane');
  
  tabContent.not(':first-child').hide();
  
  tabMnu.each(function(i){
    $(this).attr('data-tab','tab'+i);
  });
  tabContent.each(function(i){
    $(this).attr('data-tab','tab'+i);
  });
  
  tabMnu.click(function(){
    var tabData = $(this).data('tab');
    tabWrapper.find(tabContent).hide();
    tabWrapper.find(tabContent).filter('[data-tab='+tabData+']').show(); 
  });
  
  $('.tab-mnu > li').click(function(){
    var before = $('.tab-mnu li.active');
    before.removeClass('active');
    $(this).addClass('active');
   });
  
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console