css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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 id="container">
    
    
    <input hidden type="radio" name="carousel-control" id="button_a" checked/>
    <input hidden type="radio" name="carousel-control" id="button_b"/>
    <input hidden type="radio" name="carousel-control" id="button_c"/>
    <input hidden type="radio" name="carousel-control" id="button_d"/>            
            
    
    <div id="carousel">
        <div class="p-wrapper">
                    
            <section class="panel_a">
                <h1>Basic Vertical CSS Carousel Demo</h1>
                <h2>Panel a</h2>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus ornare faucibus diam id maximus. Fusce at efficitur nunc. Curabitur sed ullamcorper orci. Nam nulla enim, ultricies nec lectus a, commodo volutpat nisi. Pellentesque facilisis lacinia ante, eu pulvinar ante varius a. Fusce tincidunt efficitur tempor. Praesent pretium felis consectetur posuere sagittis. Sed luctus nisl non vestibulum semper. Vivamus mi velit, porttitor ac malesuada at, vulputate venenatis augue.</p>
                <p>Morbi faucibus, nisi ac vulputate mattis, turpis tortor maximus nibh, nec interdum lectus sem sit amet enim. Integer non nulla vitae ex gravida egestas. Fusce sodales neque ut erat tempor euismod. Quisque imperdiet rhoncus pellentesque. Fusce vitae efficitur dolor, nec laoreet lacus. Nulla orci purus, cursus sit amet posuere ac, ultrices sed dui. Ut bibendum, dui non euismod lobortis, mi neque pretium lacus, in pulvinar libero mauris eu sem. Morbi ut felis finibus, posuere risus sit amet, malesuada leo.</p>
                <p>Nulla quis molestie mi. Cras quis magna dolor. Suspendisse a scelerisque ligula, ullamcorper imperdiet justo. Ut sit amet nisl malesuada, varius turpis quis, convallis urna. Vestibulum sed odio eget lorem porta dapibus. Mauris augue sapien, scelerisque vel neque vitae, vulputate iaculis tellus. Sed accumsan egestas sem congue vehicula. Fusce quis blandit nibh, non bibendum lorem. Integer maximus mi non eros tincidunt pretium. Curabitur tempor nisi a aliquet dictum. Sed pellentesque venenatis ex ac fermentum. Aliquam vitae tincidunt urna.</p>
                <p>Nulla sagittis quis purus vitae consequat. Nullam pharetra dignissim tempus. Pellentesque egestas elit vel arcu condimentum euismod ut eu nisi. Fusce erat lectus, placerat quis egestas posuere, sollicitudin non ligula. Suspendisse potenti. Fusce vel leo ultrices, vehicula leo quis, semper quam. Cras mollis quis sem in tempor. Proin sed dui eu arcu efficitur pulvinar at sed leo. Donec rhoncus rhoncus est, eleifend posuere neque aliquet in.</p>
            </section>
                    
            <section class="panel_b">
                <h2>Panel b</h2>
                <p>Duis sollicitudin nisi nulla. Duis fermentum consectetur ligula, nec tincidunt mi luctus eget. Aliquam erat volutpat. Mauris vitae tellus lectus. Integer dapibus ante sit amet augue malesuada, vitae auctor mi hendrerit. Phasellus scelerisque tempor lectus et venenatis. Donec vel sem turpis. Aenean convallis iaculis enim eget varius.</p>
                <p>Maecenas in pulvinar sapien, ac lobortis erat. Aliquam a consectetur nibh. Aenean sed sapien id odio malesuada bibendum. Proin volutpat scelerisque purus. Maecenas congue commodo blandit. Aliquam nec felis lectus. Nullam lorem metus, dignissim sit amet tortor quis, cursus sollicitudin nulla. In fermentum urna quis mollis mattis. Vivamus ipsum eros, lacinia a ligula non, dictum posuere ipsum.</p>
                <img src="https://static.tumblr.com/kmw8hta/o6apcizfh/onda-3220299_640.png"/>
            </section>
                    
            <section class="panel_c">
                <h2>Panel c</h2>
                <p>Fusce convallis arcu mauris, vitae semper ligula maximus vitae. Morbi a nibh id justo ullamcorper tincidunt. Aliquam et mollis mauris, eu varius metus. Praesent eget mi ac diam congue iaculis. Praesent accumsan euismod tempus. Aenean tempor libero et eros pellentesque molestie. Pellentesque malesuada ligula ut hendrerit laoreet. Ut turpis neque, tempor in ultrices sed, hendrerit ac leo. Nam placerat dolor sit amet ligula bibendum malesuada. Donec sagittis ultricies ex id mattis.</p>
                <ul>
                    <li>Aliquam iaculis enim ut mi bibendum tincidunt.</li>
                    <li>Nulla quis elit in lorem vulputate laoreet.</li>
                    <li>Praesent non lacus euismod, ultricies lectus ac, vehicula arcu.</li>
                    <li>Integer lobortis ipsum vitae velit mollis, at commodo ligula suscipit.</li>
                </ul>
                <p>Sed ut leo et mi tristique feugiat. Nunc fermentum diam mauris, in ultricies neque tincidunt dictum. Quisque ac odio dignissim, ornare enim condimentum, faucibus erat. Sed tortor turpis, imperdiet dignissim lacus eget, dignissim vehicula lorem. Mauris semper mi lacus, sit amet rutrum lacus tincidunt sed. Curabitur vel nisl eu magna placerat pretium. Curabitur malesuada sagittis tortor, eget volutpat mi pellentesque quis.</p>
            </section>
                    
            <section class="panel_d">
                <h2>Panel d</h2>
                <p>Aenean maximus accumsan mauris. Praesent rutrum vitae purus et mattis. Nunc at mi et diam pulvinar euismod. Curabitur interdum, leo quis tincidunt pharetra, risus nisl mollis velit, interdum consectetur justo orci in nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus elit turpis, tincidunt non dui et, molestie maximus nisl. Duis pretium eros sed ultricies convallis. Pellentesque vitae tempor lorem, eu laoreet metus. Vivamus sit amet lorem libero. Vestibulum tristique ligula in gravida volutpat. Sed facilisis ipsum velit, et pharetra nisi ullamcorper ut. Maecenas purus dui, tincidunt non ipsum vel, bibendum aliquam elit. Cras rutrum velit diam, semper aliquet libero posuere nec.</p>
                <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec ut eleifend lacus. Sed fringilla ullamcorper justo, porttitor cursus nisl. Sed et mi aliquet, rutrum erat at, porttitor felis. Mauris consequat mauris id posuere dictum. Proin nec congue purus, nec rhoncus justo. Cras sit amet neque eu ex feugiat auctor at dignissim augue. Sed commodo tellus id erat lobortis, sit amet elementum felis commodo. Ut massa diam, tristique vel lacinia sed, vulputate eget mauris. Fusce lacinia bibendum iaculis.</p>
            </section>
                    
        </div> <!-- // .p-wrapper -->
    </div> <!-- // #carousel -->            
            
    
    <div id="navigation">
        <label for="button_a" class="label_a"> <span>a</span> </label>
        <label for="button_b" class="label_b"> <span>b</span> </label>
        <label for="button_c" class="label_c"> <span>c</span> </label>
        <label for="button_d" class="label_d"> <span>d</span> </label>
    </div> <!-- // #navigation -->               
            
    
</div> <!-- // #container -->
            
          
!
            
              * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
            
body {
    font-family: sans-serif;
    font-size: 11px;
    line-height: 1.5em;
    text-align: justify;
    padding: 48px;
    color: #aaa;
    background-color: #f5f5f5;
}
            
#container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
            
#carousel, #navigation {
    flex: initial;
    display: block;
}
            
#carousel {
    overflow: hidden;
    width: 600px;
    height: 400px;
    border-radius: 4px;
    background-color: #fff;
}
            
.p-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease-in-out;
}
            
#button_a:checked ~ #carousel .p-wrapper {
    -webkit-transform: translateY(0);
    transform: translateY(0); 
}
            
#button_b:checked ~ #carousel .p-wrapper {
    -webkit-transform: translateY(-100%);
    transform: translateY(-100%); 
}

#button_c:checked ~ #carousel .p-wrapper {
    -webkit-transform: translateY(-200%);
    transform: translateY(-200%); 
}

#button_d:checked ~ #carousel .p-wrapper {
    -webkit-transform: translateY(-300%);
    transform: translateY(-300%); 
}
            
[class^="panel_"] {
    overflow: auto;
    position: relative;
    width: inherit;
    height: inherit;
    padding: 48px;
}
            
#navigation {
    margin-left: 24px;
}

[class^="label_"] {
    display: block;
    cursor: pointer;
    margin: 8px 0;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 4px;
    color: #aaa;
    background-color: #fff;
    transition: all 0.3s ease;
}
            
[class^="label_"]:hover {
    color: #444;
    background-color: #ffeed9;
}
            
#button_a:checked ~ #navigation .label_a,
#button_b:checked ~ #navigation .label_b,
#button_c:checked ~ #navigation .label_c,
#button_d:checked ~ #navigation .label_d {
     cursor: default;
     color: #fff;
     background-color: #222;
}
            
          
!
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.
Loading ..................

Console