cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation


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.

    <h1>CSS Parallax Header Image</h1>
    <p>This demo uses a <a href="https://keithclark.co.uk/articles/pure-css-parallax-websites/">method discovered by Keith Clark</a> to create parallax effects in CSS, without a ton of janky Javascript and bloated jQuery plugins. </p>
              $scroll-factor : .5;

$background: #333;
$header-height : 50px;
$image : "https://pbs.twimg.com/media/B2XTRwtCAAEnqlP.jpg:large";

@import url(https://fonts.googleapis.com/css?family=Alegreya+Sans:100,300,400,500,700,800,900,500italic,400italic,100italic,900italic,300italic,700italic,800italic);

* { box-sizing: border-box; margin: 0; padding: 0; border: 0; }

main {
  height: 150vh;
  max-height: 100%;
  overflow-x: hidden;
  perspective: 1px;
  perspective-origin: center top;
  transform-style: preserve-3d;
  padding: 0 40px;
  font: 36px/1.6 Alegreya Sans, serif;

header {
  height: 80vh;
  background: url($image);
  background-size: cover;
  background-position: center center;
  position: relative;
  vertical-align: top;
  transform-origin: center top;
    translateZ(-#{$scroll-factor * 2}px)
    scale(1 + $scroll-factor * 2);

section {
  min-height: 200vh;
  background: white;
  transform: translateZ(0);
  padding: 10px 0;

h1 {
  font-size: 30px;
  font-weight: 400;
  padding: 10px 20px;

p {
  font-size: 18px;
  font-size: 300;
  padding: 0 20px;

a {
  text-decoration: none;
  color: dodgerblue;

html, body { height: 100%; }

body {
  background: $background;

Loading ..................