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.

            
              <!-- This example illustrates how to create layout of slides stacked on each  other(especially useful for fade in/out transitions). It's achieved without setting their height and avoiding position: absolute; so they are fully flexible and easy to keep in normal page flow. -->
<input type="radio" name="switch" id="i_1">
<input type="radio" name="switch" id="i_2">
<input type="radio" name="switch" id="i_3" checked>
<input type="radio" name="switch" id="i_4">
<input type="radio" name="switch" id="i_5">
<input type="radio" name="switch" id="i_6">
<div class="wrapper">
  <div class="slide">
    <div class="content content1">
        <p>Nullam quis pretium nisl, suscipit imperdiet metus. Fusce efficitur odio id dolor egestas, quis dignissim orci consequat. Pellentesque libero nunc, volutpat et ligula eu, aliquam iaculis odio. 
          <p>In venenatis aliquet ligula sed accumsan. Maecenas imperdiet a ligula eleifend consectetur.

<p>Nam a urna dapibus, lobortis lectus vitae, blandit dolor. Donec elementum elit vitae egestas feugiat. Praesent eu mauris quis leo molestie eleifend. Donec est nisl, facilisis nec venenatis vitae, efficitur et augue. Donec fringilla dui dui, nec viverra metus viverra et. Etiam nec convallis est, in cursus nisi. Integer vel ullamcorper ante.  <p>Pellentesque et viverra risus. Duis volutpat felis sit amet dictum fermentum. Fusce condimentum porta diam, ut commodo orci accumsan sed. Aenean mi leo, lobortis eu porta a, mattis malesuada nisi. Morbi varius efficitur nisi ac mollis. Fusce et mauris vitae sem varius porttitor. 
      <p>Nullam vel elit massa. Nam sed egestas neque, ut sollicitudin urna. Curabitur vestibulum felis vitae sapien venenatis mattis.

<p>Praesent mattis est faucibus tellus eleifend viverra. Nam non lectus vulputate lacus tristique fermentum. Fusce venenatis mollis imperdiet. Nunc dictum nisi quis mauris varius tincidunt. Suspendisse imperdiet felis lectus. Nunc pharetra tellus ac nulla scelerisque pulvinar. Fusce non blandit dui, sed facilisis neque. Donec gravida nibh dolor, vitae imperdiet lorem varius et. Maecenas pulvinar enim eget velit porta lobortis. Pellentesque sagittis tristique fermentum. <p>Aliquam pretium magna sed consectetur pellentesque. Maecenas id sem eu urna molestie lobortis lacinia nec nulla. Donec tristique tellus lectus, eu faucibus erat tincidunt non. Nunc ut mollis velit.
    </div>   
  </div>
  <div class="slide">
    <div class="content content2">
      <span>♫</span>
    </div>    
  </div>
  <div class="slide">
    <div class="content content3">
      
    </div>
  </div>
  <div class="slide">
    <div class="content content4">
  <p>Nullam vel elit massa. Nam sed egestas neque, ut sollicitudin urna. Curabitur vestibulum felis vitae sapien venenatis mattis.

<p>Praesent mattis est faucibus tellus eleifend viverra. Nam non lectus vulputate lacus tristique fermentum. Fusce venenatis mollis imperdiet. Nunc dictum nisi quis mauris varius tincidunt. Suspendisse imperdiet felis lectus. Nunc pharetra tellus ac nulla scelerisque pulvinar. Fusce non blandit dui, sed facilisis neque. Donec gravida nibh dolor, vitae imperdiet lorem varius et. Maecenas pulvinar enim eget velit porta lobortis. Pellentesque sagittis tristique fermentum. <p>Aliquam pretium magna sed consectetur pellentesque. Maecenas id sem eu urna molestie lobortis lacinia nec nulla. Donec tristique tellus lectus, eu faucibus erat tincidunt non. Nunc ut mollis velit.     
    </div>    
  </div>
  <div class="slide">
    <div class="content content5">
      <span>♪</span>
    </div>    
  </div>
  <div class="slide">
    <div class="content content6">
      <span>♬</span>
    </div>   
  </div>  
</div>
<div class="controls">
  <label for="i_1">⬤</label>
  <label for="i_2">⬤</label>
  <label for="i_3">⬤</label>
  <label for="i_4">⬤</label>
  <label for="i_5">⬤</label>
  <label for="i_6">⬤</label>
</div>
<a target="_blank" href="https://twitter.com/kamildyrek"><svg style="width:2em;height:2em;position:fixed;top:1em;left:1em;opacity:.8;" viewBox="0 0 24 24"><path fill="#fff" d="M17.71,9.33C18.19,8.93 18.75,8.45 19,7.92C18.59,8.13 18.1,8.26 17.56,8.33C18.06,7.97 18.47,7.5 18.68,6.86C18.16,7.14 17.63,7.38 16.97,7.5C15.42,5.63 11.71,7.15 12.37,9.95C9.76,9.79 8.17,8.61 6.85,7.16C6.1,8.38 6.75,10.23 7.64,10.74C7.18,10.71 6.83,10.57 6.5,10.41C6.54,11.95 7.39,12.69 8.58,13.09C8.22,13.16 7.82,13.18 7.44,13.12C7.81,14.19 8.58,14.86 9.9,15C9,15.76 7.34,16.29 6,16.08C7.15,16.81 8.46,17.39 10.28,17.31C14.69,17.11 17.64,13.95 17.71,9.33M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2Z" /></svg></a>
            
          
!
            
              @import url("https://fonts.googleapis.com/css?family=Lato:400,400i,700");

/* Some resets, not essencial for this example to work */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

/* Base styles for this example */

.wrapper {
  width: 50vw; /* unfortunately width has to be set to some hard value */
  display: flex;
}

.slide {
  width: 0;
}

.content {
  width: 50vw;
  height: 100%; /* this is optional if you want every slide to have same height as the highest one */
}

/* Additional styling */

html, body {
  background-color: #BDBDBD;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center; 
  font-family: Lato;
}

.wrapper {
  margin: 0 auto;
  background-color: white;
  box-shadow: 3px 3px 20px #9E9E9E;
}

span {
  background-color: white;
  text-align: center;
  line-height: 4rem;
  width: 4rem;
  border-radius: 8rem;
  color: #616161;
  font-size: 2rem;
}

.content {
  padding: 30px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .6s;
  max-height: 90vh;
  overflow-y: auto;
}

.content2,
.content5,
.content6
{
  display: flex;
  justify-content: center;
  align-items: center;  
  background-color: #E0E0E0;
}

.content3 {
  background-image: url(https://images.unsplash.com/photo-1507473885765-e6ed057f782c?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=800&fit=max&ixid=eyJhcHBfaWQiOjE0NTg5fQ);
  background-size: cover;
  background-position: center;
}
#i_1:checked ~ .wrapper .content1,
#i_2:checked ~ .wrapper .content2,
#i_3:checked ~ .wrapper .content3,
#i_4:checked ~ .wrapper .content4,
#i_5:checked ~ .wrapper .content5,
#i_6:checked ~ .wrapper .content6 {
  opacity: 1;
  pointer-events: auto;
}

label {
  color: #E0E0E0;
  transition-duration: .6s;
  cursor: pointer;
}

#i_1:checked ~ .controls label[for="i_1"],
#i_2:checked ~ .controls label[for="i_2"],
#i_3:checked ~ .controls label[for="i_3"],
#i_4:checked ~ .controls label[for="i_4"],
#i_5:checked ~ .controls label[for="i_5"],
#i_6:checked ~ .controls label[for="i_6"] {
  color: #424242;
}
            
          
!
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