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

              
                <html>
<style>
.tuna {
  animation: walk-cycle 1s steps(12) infinite;
  background: url(http://stash.rachelnabors.com/img/codepen/tuna_sprite.png) 0 0 no-repeat; 
  height: 200px;
  width: 400px;
  position: absolute;
  bottom: 1px;
  left: 50%;
  margin-left: -200px;
  -webkit-animation-name: walk-cycle; /* David Letts is a walking zombie*/
  -webkit-animation-duration: 1s;
  -webkit-animation-timing-function: steps(12);
  -webkit-animation-iteration-count: infinite;
  transform: translateZ(0); /* Turn on GPU */
  -webkit-transform: translateZ(0); /* Turn on GPU */
}

@keyframes walk-cycle {  
  0% {background-position: 0px 0px; } 
  100% {background-position: 0px -2391px; } 
}

@-webkit-keyframes walk-cycle {  
  0% {background-position: 0px 0px; } 
  100% {background-position: 0px -2391px; } 
}

.foreground, .midground, .background {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0; left: 0;
  translate3d(0,0,0);
  -webkit-transform: translate3d(0,0,0); /* Safari and Chrome */
}

.foreground {
  animation: parallax_fg linear 10s infinite both;
  background:  url(http://stash.rachelnabors.com/24ways2012/foreground_grass.png) 0 100% repeat-x;
  z-index: 3;
  -webkit-animation-name: parallax_fg;
  -webkit-animation-timing-function: linear;
  -webkit-animation-duration: 10s;
  -webkit-animation-iteration-count: infinite;
  -webkit-animation-fill-mode: both;
}

@keyframes parallax_fg {  
  0% { background-position: -3584px 100%;} 
  100% {background-position: 0% 100%; } 
}

@-webkit-keyframes parallax_fg {  
  0% { background-position: -3584px 100%;} 
  100% {background-position: 0% 100%; } 
}

.midground {
  animation: parallax_mg linear 20s infinite;
  -webkit-animation-name: parallax_mg;
  -webkit-animation-timing-function: linear;
  -webkit-animation-duration: 20s;
  -webkit-animation-duration infinite;
  background:  url(http://stash.rachelnabors.com/24ways2012/midground_grass.png) 0 100% repeat-x;
  z-index: 2;
}

@keyframes parallax_mg {  
  0% { background-position: -3000px 100%;} 
  100% {background-position: 0% 100%; } 
}

@-webkit-keyframes parallax_mg {  
  0% { background-position: -3000px 100%;} 
  100% {background-position: 0% 100%; } 
}

.background {
  background-image:
    url(http://stash.rachelnabors.com/24ways2012/background_mountain5.png),
    url(http://stash.rachelnabors.com/24ways2012/background_mountain4.png),
    url(http://stash.rachelnabors.com/24ways2012/background_mountain3.png),
    url(http://stash.rachelnabors.com/24ways2012/background_mountain2.png),
    url(http://stash.rachelnabors.com/24ways2012/background_mountain1.png);
  background-repeat: repeat-x;
  background-position: 0 100%;
  z-index: 1;
  animation: parallax_bg linear 40s infinite;
  -webkit-animation-name: parallax_bg;
  -webkit-animation-timing-function: linear;
  -webkit-animation-duration: 40s;
  -webkit-animation-iteration-count: infinite;
}

@keyframes parallax_bg {  
  0% { background-position: -2400px 100%, -2000px 100%, -1800px 100%, -1600px 100%, -1200px 100%;} 
  100% {background-position: 0 100%, 0 100%, 0 100%, 0 100%, 0 100%; } 
}


@-webkit-keyframes parallax_bg {  
  0% { background-position: -2400px 100%, -2000px 100%, -1800px 100%, -1600px 100%, -1200px 100%;} 
  100% {background-position: 0 100%, 0 100%, 0 100%, 0 100%, 0 100%; } 
}


body {
    background: linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%),
    #d2d2d2 url(http://stash.rachelnabors.com/24ways2012/background_clouds.png);
}
</style>

<div class="foreground"></div>

<div class="midground">
  <div class="tuna"></div>
</div>

<div class="background">
</div>
</html>
              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console