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

              
                header
  h1 Tabs with Slanted Edges
  ul.tabs
    li
      a href='#' Tab Number One
    li.-active
      a href='#' Tab Number Two
    li
      a href='#' Tab Number Three
    li
      a href='#' Tab Number Four
section
  h2 Active Tag Content
  p Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis efficitur justo, vel fermentum felis faucibus non. Aliquam malesuada mollis magna ut consequat. Mauris ultricies scelerisque volutpat. Suspendisse convallis lorem ac eros iaculis, ut porttitor lorem pretium. Aenean vitae sapien sed massa bibendum placerat sit amet ac nunc. Proin in mauris volutpat, pretium lectus vitae, mollis urna. Curabitur velit nibh, sagittis eget lorem et, eleifend tristique purus.
  p Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis efficitur justo, vel fermentum felis faucibus non. Aliquam malesuada mollis magna ut consequat. Mauris ultricies scelerisque volutpat. Suspendisse convallis lorem ac eros iaculis, ut porttitor lorem pretium. Aenean vitae sapien sed massa bibendum placerat sit amet ac nunc. Proin in mauris volutpat, pretium lectus vitae, mollis urna. Curabitur velit nibh, sagittis eget lorem et, eleifend tristique purus.

              
            
!

CSS

              
                $tab-border: #cbd0d8;
$tab-background: #e2e6eb;
$tab-max: 20;

body {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  color: #333;
  margin: 0;
  padding: 0;
}

header {
  background: #f5f6f8;
  padding: 20px 30px 0;
  position: relative;
  
  h1 {
    font-weight: 500;
    margin: 0;
  }
}

ul.tabs {
  display: flex;
  margin: 25px 0 0;
  padding: 0;
  
  &:after {
    background-image: linear-gradient(transparent 60%, rgba(0,0,0,.6) 100%);
    bottom: 0;
    content: '';
    display: block;
    left: 0;
    height: 10%;
    opacity: .2;
    position: absolute;
    right: 0;
    z-index: $tab-max;
  }
  
  li {
    list-style: none;
    display: flex;
    margin: 0 12px 0 0;
    position: relative;
    
    // Max 20 Tabs
    // This can also be done via js.
    @for $i from 1 through $tab-max {
      &:nth-of-type(#{$i}) {
        z-index: #{$tab-max - $i};
      }
    }
    
    a {
      background: $tab-background;
      border-top: 1px solid $tab-border;
      color: #708096;
      padding: 6px 10px 5px;
      position: relative;
      text-decoration: none;
      
      &:before,
      &:after {
        content: '';
        height: 100%;
        display: block;
        position: absolute;
        top: 0;
        white-space: nowrap;
        width: 10px;
      }
      
      &:before {
        background-image: linear-gradient(108deg, transparent 0%, transparent 45%, $tab-border 45%, $tab-border 52%, $tab-background 53%);
        background-position: 0 0;
        left: -9px;
      }
      
      &:after {
        background-image: linear-gradient(253deg, transparent 0%, transparent 45%, $tab-border 45%, $tab-border 52%, $tab-background 53%);
        background-position: 0 0;
        right: -9px;
      }
    }
    
    &.-active {
      z-index: $tab-max + 1;
      
      a {
        background: white;
        color: #009aff;
        
        &:before {
          background-image: linear-gradient(108deg, transparent 0%, transparent 45%, $tab-border 45%, $tab-border 52%, white 53%);
        }
        
        &:after {
          background-image: linear-gradient(253deg, transparent 0%, transparent 45%, $tab-border 45%, $tab-border 52%, white 53%);
        }
      }
    }
  }
}

section {
  padding: 30px;
  
  h2 {
    font-weight: 400;
    margin: 0 0 20px;
  }
}
              
            
!

JS

              
                $('.tabs li a').click(e => {
  $('.tabs li').removeClass('-active');
  $(e.target).closest('li').addClass('-active');
  e.preventDefault();
});
              
            
!
999px

Console