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

              
                <div class="hero">
</div>

<div class="image-text-sticky">
  <div class="position-sticky image-col" style="background-image: url('https://i.imgur.com/S0gmGN7.png')">
  </div>
  <div>
    <div class="group">
      <h2>A COASTAL ESCAPE TO NEWQUAY</h2>
      <p>Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Quisque velit nisi, pretium ut lacinia in, elementum id enim. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Curabitur arcu erat, accumsan id imperdiet et, porttitor at sem. Curabitur arcu erat, accumsan id imperdiet et, porttitor at sem. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sollicitudin molestie malesuada.</p>
    </div>
    <div class="image-group">
      <img src="https://i.imgur.com/6I7pU59.png">
    </div>
  </div>
</div>

<div class="image-text-sticky">
  <div class="position-sticky image-col" style="background-image: url('https://i.imgur.com/H4wiSZd.png')">
  </div>
  <div>
    <div class="group">
      <h2>What's your holiday style?</h2>
      <p>Nulla quis lorem ut libero malesuada feugiat. Cras ultricies ligula sed magna dictum porta. Nulla porttitor accumsan tincidunt. Nulla porttitor accumsan tincidunt. Proin eget tortor risus. Pellentesque in ipsum id orci porta dapibus. Nulla porttitor accumsan tincidunt. Curabitur aliquet quam id dui posuere blandit. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus.</p>
    </div>
    <div class="image-group">
      <img src="https://i.imgur.com/FQe1H1C.png">
    </div>
  </div>
</div>

<!-- <div class="image-text flip">
  <div>
    <img src="http://placehold.it/800x800">
  </div>
  <div>
    this text should never be seen
  </div>
</div> -->

<div class="newsletter-signup">
  <div>testimonials</div>
</div>

<footer>
  <div>footer</div>
</footer>

              
            
!

CSS

              
                body {
  font-family: Arial;
}

h2 {
  font-size: 3rem;
  color: #888;
}

p {
  line-height: 1.4;
}

.hero {
  height: 919px; 
  background-color: #ccc;
  border: 1rem solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url('https://i.imgur.com/INzfDae.png');
  //background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
}

.image-text-sticky {
  display: flex;
  padding-bottom: 2rem;
  & > div {
    width: 50%;
  }
  .image-col {
    height: 100vh;
    background-image: url('http://placehold.it/800x800');
    background-size: cover; 
    background-position: center;
  }
  .group {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 10rem;
    &.border-bottom {
      border-bottom: 1px solid #ccc;
    }
  }
  .image-group {
    
  }
  &.flip {
    & > :nth-of-type(0) {
      order: 2;
    }
    & > :nth-of-type(1) {
      order: 1;
    }
  }
}

.position-sticky {
  position: sticky;
  top: 0;
}

img {
  max-width: 100%;
}

.newsletter-signup {
  height: 45vh; 
  background-color: #ccc;
  border: 1rem solid white;
  display: flex;
  align-items: center;
  justify-content: center;
}

footer {
  height: 100vh; 
  background-color: #ccc;
  border: 1rem solid white;
  display: flex;
  align-items: center;
  justify-content: center;
}

              
            
!

JS

              
                
              
            
!
999px

Console