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="container">
        <a href="#tab1" class="tab current">
            <h3>Tab 1</h3>
        </a>
        <a href="#tab2" class="tab">
            <h3>Tab 2</h3> 
        </a>
        <a href="#tab3" class="tab">
            <h3>Tab 3</h3>
        </a>
        <a href="#tab4" class="tab">
            <h3>Tab 4</h3>
        </a>
        <a href="#tab5" class="tab">
            <h3>Tab 5</h3> 
        </a>
        <div class="tab-content current" id="tab1">
            <h2>Content 1</h2>
            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Id iure pariatur sapiente exercitationem cupiditate suscipit labore adipisci maxime quo dolore. Assumenda laborum pariatur incidunt fuga quibusdam accusamus. Voluptatum, accusamus, doloremque.</p>
        </div>
        <div class="tab-content" id="tab2">
            <h2>Content 2</h2>
            <p>Laborum quae eveniet, architecto atque quis provident eaque natus est facilis, quaerat molestiae obcaecati, illo placeat labore explicabo ab odio nostrum voluptatem repudiandae officia voluptatum optio fugiat sunt nesciunt! In.</p>
        </div>
        <div class="tab-content" id="tab3">
            <h2>Content 3</h2>
            <p>Sit eos sed minima maiores nisi! Delectus harum ratione hic esse? Obcaecati ducimus at totam debitis, neque in recusandae! Quis maiores perspiciatis repellat minima fugiat impedit consequuntur, omnis veritatis illo.</p>
        </div>
        <div class="tab-content" id="tab4">
            <h2>Content 4</h2>
            <p>Quod esse totam similique quo culpa perspiciatis beatae dignissimos vel distinctio laudantium autem, doloremque officia, voluptates est rerum. Ducimus dolor ad sit, eius quod distinctio cum omnis molestias aut quaerat!</p>
        </div>
        <div class="tab-content" id="tab5">
            <h2>Content 5</h2>
            <p>Suscipit a illo quo excepturi ut tempore similique amet quisquam illum, pariatur eligendi voluptatem, vitae reiciendis autem, veritatis animi aperiam quae reprehenderit magnam! Asperiores consequatur, ad eos animi nesciunt tenetur.</p>
        </div>
    </div>
            
          
!
            
              * {
    box-sizing: border-box;
}
body {
    width: 90%;
    margin: 20px auto;
    font-family: 'Montserrat', sans-serif;
}
.tabs {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}
.container {
    height: 200px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}
.tab-content {
    width: 100%;
    display: none;
    border: 1px solid #0f0;
    padding: 15px;
}
.tab-content.current {
    display: block;
}
.tab {
    color: inherit;
    text-decoration: none;
    margin-right: 3px;
}
.tab h3 {
    border: 1px solid #ccc;
    border-top-width: 5px;
    border-bottom: 0;
    padding: 10px 15px;
    margin: 0;
    background-color: #fff;
}
.tab.current h3 {
    border-color: #0f0;
    position: relative;
    top: 1px;
}
@media (max-width: 480px) {
    .container {
        -webkit-flex-direction: column;
        -ms-flex-direction: column;
        flex-direction: column;
        height: auto;
    }
    .tab {
        width: 100%;
        margin-right: 0;
    }
    .tab:first-child {
        order: 1
    }
    #tab1 {
        order: 2;
    }
    .tab:nth-child(2) {
        order: 3
    }
    #tab2 {
        order: 4;
    }
    .tab:nth-child(3) {
        order: 5
    }
    #tab3 {
        order: 6;
    }
    .tab:nth-child(4) {
        order: 7
    }
    #tab4 {
        order: 8;
    }
    .tab:nth-child(5) {
        order: 9
    }
    #tab5 {
        order: 10;
    }
}
            
          
!
            
              $('.tab').click(function() {
                $('.tab.current').removeClass('current');
 $(this).addClass('current');
 $('.tab-content.current').removeClass('current');
 $('.container').find($(this).attr('href')).addClass('current');
 
 });
            
          
!
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