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

              
                <!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" type="text/css" href="css/styles.css">
  <title>Parallax</title>
</head>
<body>

  <header>
    <h1>Life Is Beautiful :)</h1>
  </header>
  
  <section class="paragraph">
    Lorem ipsum dolor sit amet consectetur adipisicing elit. Quas omnis accusamus unde deserunt. Sapiente laboriosam sequi cupiditate sint debitis veritatis exercitationem dignissimos est enim molestias accusamus, suscipit nostrum asperiores minus!
    Eligendi ab fugiat dignissimos ipsam minima necessitatibus provident repellendus neque odit numquam aliquam expedita suscipit doloribus nesciunt facilis, molestiae quibusdam! Odit excepturi ab iure, aspernatur nemo aut repudiandae? Doloribus, earum?
    Eius blanditiis maxime impedit harum quasi pariatur atque beatae omnis expedita dolorum, vero explicabo numquam mollitia libero ut ratione, sit, amet assumenda voluptatem deserunt magnam rem facilis. Dolor, porro non?
    Tempore atque fugit quaerat neque esse? Unde doloremque odit distinctio mollitia quae quasi itaque atque dolor voluptatibus eligendi nemo labore repudiandae, sit maiores at eius. Nulla ipsa voluptatibus laboriosam culpa!
    Iusto ipsum aliquam obcaecati a ullam fuga dolorem dolores, eius, beatae corporis repudiandae quibusdam ab natus? Voluptates unde quaerat quas, placeat, blanditiis hic totam harum tempore assumenda ullam voluptatibus quod.
  </section>

</body>
</html>
              
            
!

CSS

              
                * {
  padding: 0;
  margin: 0;
}

/* this style for "html" is must, otherwise nothing will work */

html {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  width: 100%;
  height: 100%;
  perspective: 1px;
  transform-style: preserve-3d;
  overflow-x: hidden;
  overflow-y: scroll;
  font-family: sans-serif;
  color: #fff;
}

header {
  width: 100vw;
  min-height: 100vh;
  position: relative;
  transform-style: preserve-3d;
}

header h1 {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* placing the actual background image using pseudo selector */
header::before {
  content: "";
  min-height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background-image: url(https://www.pexels.com/photo/326055/download/?search_query=fantasy&tracking_id=4y5tsdeixje);
  background-size: cover;
  transform: translateZ(-1px) scale(2);
  z-index: -1;
}

.paragraph {
  position: absolute;
  top: 100vh;
  background-color: #111;
  line-height: 2;
  padding: 70px;
  font-size: 1.2rem;
}
              
            
!

JS

              
                
              
            
!
999px

Console