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

              
                <section id="one">
  <div class="container">
    <header>
      <h1 class="s-heading">First Section Heading</h1>
    </header>
    <article>
      <p>Vegan yr tacos everyday carry, street art banjo cardigan four dollar toast franzen poutine wolf celiac portland keytar lo-fi. Williamsburg locavore blue bottle man bun XOXO, helvetica edison bulb.</p>
    </article>
  </div> <!-- .container -->
</section> <!-- .section -->


<section id="two">
  <div class="outer">
    <div class="inner sticky-content">
      <div class="container">
        <div>
         </div> <!-- .container -->
        </div> <!-- .inner -->
      </div> <!-- .outer -->
</section> <!-- .section -->

  
<section id="three">
  <div class="container">
    <header>
      <h1 class="s-heading">Third Section Heading</h1>
    </header>
    <article>
      <p>Mlkshk 3 wolf moon slow-carb, dreamcatcher schlitz yr chia edison bulb butcher forage yuccie four loko thundercats glossier street art. Migas tumblr knausgaard glossier leggings biodiesel. Pinterest intelligentsia chillwave, glossier cronut
              pug poke microdosing bushwick ennui. Chicharrones +1 subway tile, fap franzen edison bulb truffaut iPhone quinoa chambray meditation food truck leggings tumeric fashion axe. Etsy bespoke tattooed, cronut aesthetic flannel microdosing iceland
              wayfarers selfies pour-over. Pabst bushwick skateboard waistcoat migas, pork belly flexitarian asymmetrical echo park retro master cleanse XOXO viral lomo wolf. Kogi bicycle rights mumblecore mlkshk succulents, post-ironic beard ennui live-edge
              man bun etsy.
      </p>
    </article>
  </div> <!-- .container -->
</section> <!-- .section -->

<section id="four">
  <div class="container">
    <header>
      <h1 class="s-heading">Fourth Section Heading</h1>
    </header>
    <article>
      <p>Small batch butcher hot chicken, literally gochujang cray organic copper mug venmo disrupt subway tile bushwick lyft. </p>
    </article>
  </div>
  <!-- .container -->
</section>
<!-- .section -->
  
  
<section id="five">
  <div class="outer">
    <div class="inner sticky-content">
      <div class="container">
        <div>
         </div> <!-- .container -->
        </div> <!-- .inner -->
      </div> <!-- .outer -->
</section> <!-- .section -->

  
<section id="six">
  <div class="container">
    <header>
      <h1 class="s-heading">Third Section Heading</h1>
    </header>
    <article>
      <p>Mlkshk 3 wolf moon slow-carb, dreamcatcher schlitz yr chia edison bulb butcher forage yuccie four loko thundercats glossier street art. Migas tumblr knausgaard glossier leggings biodiesel. Pinterest intelligentsia chillwave, glossier cronut
              pug poke microdosing bushwick ennui. Chicharrones +1 subway tile, fap franzen edison bulb truffaut iPhone quinoa chambray meditation food truck leggings tumeric fashion axe. Etsy bespoke tattooed, cronut aesthetic flannel microdosing iceland
              wayfarers selfies pour-over. Pabst bushwick skateboard waistcoat migas, pork belly flexitarian asymmetrical echo park retro master cleanse XOXO viral lomo wolf. Kogi bicycle rights mumblecore mlkshk succulents, post-ironic beard ennui live-edge
              man bun etsy.
      </p>
    </article>
  </div> <!-- .container -->
</section> <!-- .section -->
  
  
<section id="seven">
  <div class="container">
    <header>
      <h1 class="s-heading">Seventh Section Heading</h1>
    </header>
    <article>
      <p>Vegan yr tacos everyday carry, street art banjo cardigan four dollar toast franzen poutine wolf celiac portland keytar lo-fi. Williamsburg locavore blue bottle man bun XOXO, helvetica edison bulb.</p>
    </article>
  </div> <!-- .container -->
</section> <!-- .section -->  
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Roboto:300,700);

$blue: #6da5ff;
$white: #f4f4f4;




html,
body {
  background: $blue;
  font-family: 'Roboto', sans-serif;
  font-weight:300;
  height: 100%;
}

*,
*:after,
*:before {
  box-sizing: border-box;
}

h1 {
  padding: 20% 0 0 0;
  margin: 0;
  text-align: center;
  font-size:2.2em;
}

p {
  font-size:1.2em;
  text-align: left;
  color: transparentize($white, .5);
  line-height: 1.5;
}

section {
  color: white;
  position: relative;
  height: 100%;
  height: 100vh;
  margin: 0;
  padding: 0;
  
  &#one {
    background: $blue;
  }
  
  &#two {
    height: 1000px;
    background: lighten($blue, 5);
    
    &.is-active {
      background: darken($blue, 5);
    }
    
     .outer {
      height: 4000px;
    }

    .inner {
      height: 1000px;
      background-image: url(https://c1.staticflickr.com/2/1690/24482853472_282101f633_k.jpg);
      background-size: cover;
      background-position: center center;
      background-repeat: no-repeat;
    }
  }
 
  
  &#three {
    background: transparent;
    color: black;
    position: relative;
    
    p {
      color: black;
    }
  }
 
  &#four {
    background: lighten($blue, 15);
  }


  
  &#five {
    height: 1000px;
    background: lighten($blue, 5);
    
    &.is-active {
      background: darken($blue, 5);
    }
    
     .outer {
      height: 3600px;
    }

    .inner {
      height: 1000px;
      background-image: url(https://c1.staticflickr.com/9/8532/8625031423_f8af1a4d83_k.jpg);
      background-size: cover;
    }
  }
 
  
  &#six {
    background: transparent;
  }

  
  &#seven {
    background: $blue;
  }  
  
  .container {
    padding:1em;
    position: relative;
    margin: 0 auto;
    max-width: 560px;
  }
}
              
            
!

JS

              
                /*
 Sticky-kit v1.1.3 | MIT | Leaf Corcoran 2015 | http://leafo.net
*/
(function(){var c,f;c=window.jQuery;f=c(window);c.fn.stick_in_parent=function(b){var A,w,J,n,B,K,p,q,L,k,E,t;null==b&&(b={});t=b.sticky_class;B=b.inner_scrolling;E=b.recalc_every;k=b.parent;q=b.offset_top;p=b.spacer;w=b.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t="is_stuck");A=c(document);null==w&&(w=!0);L=function(a){var b;return window.getComputedStyle?(a=window.getComputedStyle(a[0]),b=parseFloat(a.getPropertyValue("width"))+parseFloat(a.getPropertyValue("margin-left"))+
parseFloat(a.getPropertyValue("margin-right")),"border-box"!==a.getPropertyValue("box-sizing")&&(b+=parseFloat(a.getPropertyValue("border-left-width"))+parseFloat(a.getPropertyValue("border-right-width"))+parseFloat(a.getPropertyValue("padding-left"))+parseFloat(a.getPropertyValue("padding-right"))),b):a.outerWidth(!0)};J=function(a,b,n,C,F,u,r,G){var v,H,m,D,I,d,g,x,y,z,h,l;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k));if(!g.length)throw"failed to find stick parent";
v=m=!1;(h=null!=p?p&&a.closest(p):c("<div />"))&&h.css("position",a.css("position"));x=function(){var d,f,e;if(!G&&(I=A.height(),d=parseInt(g.css("border-top-width"),10),f=parseInt(g.css("padding-top"),10),b=parseInt(g.css("padding-bottom"),10),n=g.offset().top+d+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css("margin-top"),10)||0)-q,u=a.outerHeight(!0),r=a.css("float"),h&&h.css({width:L(a),
height:u,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),e))return l()};x();if(u!==C)return D=void 0,d=q,z=E,l=function(){var c,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+d>C+n,v&&!k&&(v=!1,a.css({position:"fixed",bottom:"",top:d}).trigger("sticky_kit:unbottom"))),e<F&&(m=!1,d=q,null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.detach()),c={position:"",width:"",top:""},a.css(c).removeClass(t).trigger("sticky_kit:unstick")),
B&&(c=f.height(),u+q>c&&!v&&(d-=l,d=Math.max(c-u,d),d=Math.min(q,d),m&&a.css({top:d+"px"})))):e>F&&(m=!0,c={position:"fixed",top:d},c.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(c).addClass(t),null==p&&(a.after(h),"left"!==r&&"right"!==r||h.append(a)),a.trigger("sticky_kit:stick")),m&&w&&(null==k&&(k=e+u+d>C+n),!v&&k)))return v=!0,"static"===g.css("position")&&g.css({position:"relative"}),a.css({position:"absolute",bottom:b,top:"auto"}).trigger("sticky_kit:bottom")},
y=function(){x();return l()},H=function(){G=!0;f.off("touchmove",l);f.off("scroll",l);f.off("resize",y);c(document.body).off("sticky_kit:recalc",y);a.off("sticky_kit:detach",H);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});g.position("position","");if(m)return null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on("touchmove",l),f.on("scroll",l),f.on("resize",y),c(document.body).on("sticky_kit:recalc",y),a.on("sticky_kit:detach",H),setTimeout(l,
0)}};n=0;for(K=this.length;n<K;n++)b=this[n],J(c(b));return this}}).call(this);


$(".inner.sticky-content").stick_in_parent();
              
            
!
999px

Console