Pen Settings

HTML

CSS

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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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.

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>Overlapping sections</h1>
</header>

<section class="about">
  <p>On the Friends With Benefits site, there's a great effect where each section sticks to the top of the page and other sections overlap it in a parallax style. In this tutorial, we talk about how it was achieved.
  </p>
</section>

<section class="photo photo1">
  <img src="https://images.unsplash.com/photo-1470231382218-13fc9340fbc2?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1567&q=60">
</section>

<section class="photo photo2">
  <img src="https://images.unsplash.com/photo-1486533803613-e0ce3d009238?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1489&q=60">
</section>

<section class="photo photo3">
  <img src="https://images.unsplash.com/photo-1500204904030-0cac9aa912f2?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1100&q=60">
</section>
              
            
!

CSS

              
                body {
  font-family: Helvetica;
  fontsize: 32px;
  line-height: 1.25;
  
  background-color: #fff;
  color: #333;
}

header, section {
  padding: 30px;
  
  position: sticky;
  position: -webkit-sticky;
  top: 0px;
}

section.about {
  background-color: #e4d3d2;
}
section.about p{
  max-width: 30em;
}

section.photo1{
  background-color: #d0bfbe;
}

section.photo2{
  background-color: #f9f9f9;
}

section.photo3{
  background-color: #c9bbbf;
}

section.photo {
  min-height: 100vh;
  display: flex;
  align-item: center;
  justify-content: center;
}

section.photo img{
  max-width: 1000px;
}
              
            
!

JS

              
                
              
            
!
999px

Console