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.


                <base href="">
    <p>Scroll the gallery window</p>
  <figure id="scrollcontainer">
      <img src="floating.jpg" srcset="floating.jpg 750w, floating-2x.jpg 1500w" alt="A woman in a white dress floating in the water, seen from beneath the waves">
      <img src="jelly.jpg" srcset="jelly.jpg 750w, jelly-2x.jpg 1500w" alt="A swarm of blue jellyfish">
      <img src="silk.jpg" srcset="silk.jpg 750w, silk-2x.jpg 1500w" alt="A young woman's face, eyes closed, seen underwater with her hair floating around her face">
      <img src="the-deep.jpg" srcset="the-deep.jpg 750w, the-deep-2x.jpg 1500w" alt="Blue ocean depths">


                * {
  box-sizing: border-box;
body {
  background: #102;
  color: #fff;
  margin: 3rem;
  font-family: Avenir, Helvetica, sans-serif;

article {
  width: 60%;
  margin: 0 auto;

figure {
    margin: 0;

#scrollcontainer {
  font-size: 0;
  position: relative;
  padding-top: 66%;

#scrollcontainer figure {
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  scroll-snap-type: mandatory;
  /* older spec implementation */
  scroll-snap-destination: 0% 100%;
  scroll-snap-points-y: repeat(100%);

#scrollcontainer img {
  width: 100%;
  height: auto;
  display: block;

@media all and (max-width: 800px) {
  article { width: 100%; }


                /* Uses Clemens Krack's scrollsnap-polyfill for non-supporting browsers
( */