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. 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

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>
    <div class="title paralax" style="background-image: url(https://ik.imagekit.io/fliptopbox/ariel-airport.jpg?tr=tr:n-landscape)">
        <h1>Parallax Page</h1>
        <em>A simple demo of parallax page elements using CSS &amp; HTML only</em>
    </div>

    <div class="container">
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed suscipit quam non orci aliquam imperdiet. Sed vel ipsum ac massa hendrerit bibendum. In commodo sit amet mi a dapibus. Nullam vestibulum congue eros, posuere fringilla felis condimentum semper. Maecenas porttitor dignissim scelerisque. Curabitur ac viverra quam, ut auctor metus. Suspendisse varius, sapien eu cursus vulputate, ante lacus lacinia arcu, ut convallis est erat ut nulla. Cras tempus vel dolor a auctor. Vestibulum aliquet purus felis, et ullamcorper risus placerat et.</p>
        <p>Donec non pharetra leo. Integer nec tortor nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin vitae massa iaculis, cursus lorem accumsan, iaculis libero. Phasellus consequat id lectus sit amet auctor. Maecenas tristique arcu sem, sed pretium nulla gravida ut. Nulla a dictum libero. Integer sodales fermentum enim, eu aliquet risus mollis imperdiet. Donec sit amet augue eu erat placerat auctor eget vitae purus.</p>
    </div>
</div>

<div>
    <div class="title paralax letterbox" style="background-image:url(https://ik.imagekit.io/fliptopbox/window-shopper.jpg?tr=tr:n-landscape)">
        <h1>Postbox Reveal</h1>
    </div>
    <div class="container">
        <p>Nulla vitae scelerisque risus, finibus tincidunt ipsum. Sed ipsum orci, bibendum a ante a, blandit feugiat ligula. Integer eget turpis vehicula, vehicula lacus et, sollicitudin nibh. Integer vulputate sem velit, id sollicitudin lacus porttitor eget. Donec fringilla dictum aliquam. Ut dignissim lacus tellus, quis sodales nisi elementum non. Mauris faucibus bibendum risus vitae varius. Nulla egestas accumsan dictum. Etiam vel ex ut ante finibus sodales eu et sapien. Fusce euismod leo sit amet posuere posuere. Fusce dictum mi id gravida maximus. Integer blandit urna est, ac euismod justo lobortis sed. Nulla ultricies nisl eros. Nunc imperdiet sed lectus ac feugiat. Fusce tincidunt tempor sapien.</p>
    </div>
</div>

<div>
    <div class="title paralax letterbox" style="background-image:url(https://ik.imagekit.io/fliptopbox/turbine-engine.jpg?tr=tr:n-landscape)">
    </div>
    <div class="title paralax letterbox" style="background-image:url(https://ik.imagekit.io/fliptopbox/turbine-engine.jpg?tr=w-2160,h-1080);background-size:unset;">
    </div>
    <div class="title paralax letterbox" style="background-image:url(https://ik.imagekit.io/fliptopbox/turbine-engine.jpg?tr=tr:n-landscape);background-size: 60%;background-repeat: repeat;">
    </div>
    <div class="title paralax letterbox" style="background-image:url(https://ik.imagekit.io/fliptopbox/turbine-engine.jpg?tr=tr:n-landscape)">
    </div>
    <div class="container">
        <h1>Irregular Venetian Blinds</h1>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed suscipit quam non orci aliquam imperdiet. Sed vel ipsum ac massa hendrerit bibendum. In commodo sit amet mi a dapibus. Nullam vestibulum congue eros, posuere fringilla felis condimentum semper. Maecenas porttitor dignissim scelerisque. Curabitur ac viverra quam, ut auctor metus. Suspendisse varius, sapien eu cursus vulputate, ante lacus lacinia arcu, ut convallis est erat ut nulla. Cras tempus vel dolor a auctor. Vestibulum aliquet purus felis, et ullamcorper risus placerat et.</p>
    </div>
</div>

<div class="gallery">
    <div class="title paralax square" style="background-image:url(https://ik.imagekit.io/fliptopbox/underground-tunnel.jpg?tr=w-500,h-500,fo-auto)">
    </div>
    <div class="title paralax square" style="background-image:url(https://ik.imagekit.io/fliptopbox/untitled-test-pattern.jpg?tr=w-500,h-500,fo-auto)">
    </div>
    <div class="title paralax square" style="background-image:url(https://ik.imagekit.io/fliptopbox/lamb-of-god-zurbaran-agnus.jpg?tr=w-500,h-500,fo-auto)">
    </div>
    <div class="title paralax square" style="background-image:url(https://ik.imagekit.io/fliptopbox/inferno.jpg?tr=w-500,h-500,fo-auto)">
    </div>
    <div class="title paralax square" style="background-image:url(https://ik.imagekit.io/fliptopbox/gargoyles.jpg?tr=w-500,h-500,fo-auto)">
    </div>
    <div class="title paralax square" style="background-image:url(https://ik.imagekit.io/fliptopbox/ancient-egypt.jpg?tr=w-500,h-500,fo-auto)">
    </div>
</div>

<div class="container">
    <h1>Paralax Preview Gallery</h1>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed suscipit quam non orci aliquam imperdiet. Sed vel ipsum ac massa hendrerit bibendum. In commodo sit amet mi a dapibus. Nullam vestibulum congue eros, posuere fringilla felis condimentum semper. Maecenas porttitor dignissim scelerisque. Curabitur ac viverra quam, ut auctor metus. Suspendisse varius, sapien eu cursus vulputate, ante lacus lacinia arcu, ut convallis est erat ut nulla. Cras tempus vel dolor a auctor. Vestibulum aliquet purus felis, et ullamcorper risus placerat et.</p>
</div>

<div>
    <div class="title paralax" style="background-image:url(https://ik.imagekit.io/fliptopbox/origami-crane.jpg?tr=tr:n-landscape)">
        <h1>Origami Crane</h1>
    </div>
    <div class="container">
        <p>Curabitur commodo in eros a varius. Morbi mi eros, mollis eget neque vitae, mattis cursus dui. Vestibulum eget ex eget ex efficitur tempor. Duis non ante interdum, volutpat justo pellentesque, finibus odio. Duis vestibulum rutrum accumsan. Nullam in semper tellus. Curabitur elementum elit nibh.</p>
        <p>Nulla vitae scelerisque risus, finibus tincidunt ipsum. Sed ipsum orci, bibendum a ante a, blandit feugiat ligula. Integer eget turpis vehicula, vehicula lacus et, sollicitudin nibh. Integer vulputate sem velit, id sollicitudin lacus porttitor eget. Donec fringilla dictum aliquam. Ut dignissim lacus tellus, quis sodales nisi elementum non. Mauris faucibus bibendum risus vitae varius. Nulla egestas accumsan dictum. Etiam vel ex ut ante finibus sodales eu et sapien. Fusce euismod leo sit amet posuere posuere. Fusce dictum mi id gravida maximus. Integer blandit urna est, ac euismod justo lobortis sed. Nulla ultricies nisl eros. Nunc imperdiet sed lectus ac feugiat. Fusce tincidunt tempor sapien.</p>
        <p>
        </p>
    </div>
</div>
              
            
!

CSS

              
                html,
body {
    height: 100%;
    margin: 0;
    font-size: 24px;
}

.paralax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.title {
    /* BG image set on div */
    background-color: #112233;
    color: white;
    height: 100vh;
    position: relative;
    padding: 0;
}

.title.letterbox {
    height: 33vh;
    display: flex;
    align-items: center;
}

.title.letterbox h1 {
    padding: 0;
    bottom: unset;
    margin: auto auto;
}

.title.square {
    width: 300px;
    height: 300px;
    flex: auto;
    margin: 1vh;
}

.gallery {
    display: flex;
    width: 100%;
    margin: auto;
    max-width: 1110px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.title h1 {
    margin: auto 0;
    position: absolute;
    bottom: 0;
    font-weight: bold;
    font-size: 4em;
    width: 100%;
    text-align: center;
    padding-bottom: 10vh;
    z-index: 1;
}

.title em {
    margin: auto 0;
    position: absolute;
    top: 0;
    font-size: 1em;
    width: 100%;
    text-align: center;
    padding-top: 5vh;
    z-index: 1;
}

.title:after {
    position: absolute;
    content: "";
    background: #00000022;
    width: 100%;
    height: 100%;
}

.container {
    max-width: 900px;
    margin: auto;
    padding: 5% 15%;
}

              
            
!

JS

              
                
              
            
!
999px

Console