Pen Settings



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


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


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.


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.


                <div id="image1" class="img" data-img=""><span class="multiline"><span class="max">SCROLL DOWN</span>Or just use the left and right arrows</span></div>
<div id="image2" class="img" data-img=""></div>
<div id="image3" class="img" data-img=""></div>
<div id="image4" class="img" data-img=""></div>
<div id="image5" class="img" data-img=""></div>
<div id="image6" class="img" data-img=""></div>
<div id="image7" class="img" data-img=""></div>
<div id="image8" class="img" data-img=""></div>
<div id="image9" class="img" data-img=""></div>


                @import url(,700,800);

html, body
  height: 100%;
  margin: 0;
  position: relative;
  height: 100%;
  /* attr data-type doesn't work anywhere for the moment :( */
  /* Even in chrome canary */
  /* So we do it the JS way */
  background-image: attr(data-img url); /* Keep it anyway */
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  border-bottom: 3px solid white;
  text-align: center;
  font-family: 'Open Sans', sans-serif;
  font-size: 28px;
  font-weight: bold;
  letter-spacing: -2px;
  color: rgba(255,255,255,0.85);
  text-stroke: 1.5px rgba(0,0,0,0.7);
  cursor: default;
  border-bottom: none;
  content: '';
  display: inline-block;
  height: 100%;
  vertical-align: middle;
  display: inline-block;
  display: block;
  font-size: 60px;
  letter-spacing: 1px;
.img .permalink
  position: absolute;
  right: 0;
  top: 0;
  width: 16px;
  height: 16px;
  background: url( center no-repeat;
  opacity: .2;
  transition: opacity .5s;
.img .permalink:hover
  opacity: 1;


//  Inspired by  //
//  Images from           //

  var isWebkit = navigator && navigator.userAgent.match(/webkit/i);
  var $root = $(isWebkit ? 'body' : 'html');
  var elements = $('div'), elcount = elements.length;
  var scrolling = false;
  // Replacing the CSS attr(... url)
  elements.css('background-image', function(i){
    return 'url('+$(this).data('img')+')';
  //Add permalinks
    var $t = $(this);
    var id = $t.attr('id');
    if(!id) return;
            .attr('href', '#'+id)
    if(e.keyCode != 37 && e.keyCode != 39) return;
    var current = scrolling || 0;
    if(scrolling === false)
      var bsT = $root.scrollTop(), t;
      while(current < elcount && (t = elements.eq(current).offset().top) < bsT)
    if(e.keyCode == 37) current--;
    else if(scrolling !== false || t == bsT) current++;
    current = (current + elcount) % elcount;
    $root.stop().animate({scrollTop: elements.eq(current).offset().top}, function(){scrolling = false;});
    scrolling = current;