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

              
                <dialog class="overlay" open>
  <div id="screen-1" class="screen" tabindex="0">
    <h2>Screen 1</h2>
    <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr.</p> 
    <p>Sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren</p>
    <p>No sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
    <a href="#screen-2">next</a>
  </div>
  <div id="screen-2" class="screen" tabindex="0">
    <h2>Screen 2</h2>
    <p>Justo duo dolores et ea rebum</p>
    <p>Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore</p>
    <p>Sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
    <p>magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.</p>
    <p>Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
    <p>Sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
    <p>magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.</p>
    <a href="#screen-1">previous</a>
  </div>
</dialog>

              
            
!

CSS

              
                @property --zoom {
  syntax: '<number>';
  inherits: false;
  initial-value: 1;
}

.overlay {
  display: grid;
  align-items: center;
}

.screen {
  zoom: var(--zoom);
  --zoom: 0.1;
  opacity: 0;
  
  transition-property: opacity, --zoom;
  transition-duration: 150ms;
  transition-delay: 0ms, 150ms;
  
  grid-column: 1;
  grid-row: 1;
}

.overlay:not(:focus-within) .screen:first-child,
.screen:target,
.screen:focus-within {
  --zoom: 1;
  opacity: 1;
  transition-delay: 150ms, 0ms;
}

/* Next comes the boring part */

html {
  background: grey;  
  font-family: sans-serif;
}

#screen-1 {
  width: 50vw;
}

#screen-2 {
  width: 67vw;
}

.overlay {
  top: 50%;
  transform: translateY(-50%);
  padding: 20px 30px;
  background: #fff;
  color: #222;
  border: none;
  box-shadow: 0 0 20px #0003;
}

              
            
!

JS

              
                
              
            
!
999px

Console