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

              
                <!-- Header -->
<header class="banner">
  <span class="background"></span>
  <h1>Ken Burns Banner</h1>
</header>

<!-- Other stuff -->
<main>
  <article>
    <h1>Article</h1>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut enim lorem. Aenean consectetur magna quam, ac pharetra velit molestie vitae. Donec eros nisi, condimentum in nunc eget, rutrum faucibus orci. Aenean lacinia augue vel blandit ultricies. Quisque aliquet dui egestas consectetur aliquet. Etiam semper interdum sodales. Donec vehicula arcu rutrum nisi malesuada tincidunt convallis vitae magna. Nam in tortor commodo, molestie ligula vitae, volutpat justo.</p>
    <p>Phasellus velit lectus, sagittis vitae nunc sit amet, elementum convallis nibh. Donec urna purus, faucibus a turpis a, blandit eleifend sem. Vivamus blandit, felis eu sodales cursus, elit mauris iaculis enim, quis volutpat purus massa in sapien. Fusce a enim felis. Aliquam in nulla leo. Aliquam at lacinia lectus. Nunc imperdiet dui in tortor tincidunt rutrum. Etiam porttitor metus convallis, ornare nisl a, interdum nisl. Integer lacinia quis enim nec ultrices. Mauris eget ante magna. Vestibulum volutpat adipiscing lorem et dignissim. Suspendisse sed semper ligula. Donec consequat auctor luctus. Quisque sodales, ipsum id facilisis cursus, lectus purus tincidunt massa, eu mollis odio odio ac dui. Suspendisse potenti.</p>
    <p>Nam vitae ante in augue ultrices volutpat in non turpis. Ut mattis tellus vitae condimentum sagittis. Aenean porta nisi nulla, et sagittis odio consectetur vestibulum. Proin convallis felis ut nunc aliquam auctor. Praesent aliquet ut dui fermentum viverra. Curabitur tincidunt diam tellus, aliquet porttitor nisl accumsan ut. Fusce tincidunt lorem sit amet arcu porta consequat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse potenti. Maecenas aliquet neque a risus euismod faucibus. Aenean sit amet velit bibendum, iaculis orci in, interdum sem.
</p>
    <p>Phasellus sed tortor eget odio eleifend congue non eu felis. Praesent cursus vehicula bibendum. Sed lacinia eget erat a mattis. Nulla et nisl nulla. Phasellus ac nisl augue. Sed erat quam, iaculis consectetur ante quis, imperdiet fermentum magna. Vivamus porttitor quis mi ac volutpat. Etiam libero nibh, varius id luctus sit amet, facilisis convallis erat. Nulla facilisi.</p>
  </article>
</main>
              
            
!

CSS

              
                /* Better box-sizing */
* { box-sizing: border-box; }

/* 1rem = 10px */
html { font-size: 62.5%; }

/* Default body */
body { 
  margin: 0; 
  opacity: 0;
  font: 1.6rem/1.875 'Avenir Next', sans-serif;
}

/* Loaded body */
body.loaded {
  opacity: 1;
  transition: 1s opacity;
}

/* Default banner */
.banner {
  position: relative;
  width: 100%;
  height: 40rem;
  padding: 0 5%;
  overflow: hidden;
  backface-visibility: hidden;
}

/* Default image container */
.banner .background {
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  transform: translate3d(0,0,0) scale(1.25);
  background: black url(https://images.unsplash.com/photo-1531971085967-431db1ec65a2?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=212d5ac2d6b763d2f2168d4f0a85b36c&auto=format&fit=crop&w=2250&q=80) no-repeat center center; 
  background-size: cover;
}

/* Loaded image container */
.loaded .banner .background {
  transform: scale(1);
  transition: 6.5s transform;
}

/* Other stuff */
.banner h1 {
  color: #EEE;
  margin: 0;
  line-height: 40rem;
  text-transform: uppercase;
  text-shadow: 0 0 .3rem black;
}

main { 
  width: 90%;
  margin: 5rem auto;
}

main p { margin: 0 0 3rem 0; }
              
            
!

JS

              
                // Trigger class name on load
window.onload = function() {
  document.body.className += ' loaded'
};
              
            
!
999px

Console