Pen Settings



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


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.


              <div class="wrapper">
  <div class="tunnel tunnel1"></div>
  <div class="tunnel tunnel2"></div>
  <div class="tunnel tunnel3"></div>

  SVG Background Images Performance tips!

  1. The FPS gets better the smaller the SVG file.
  2. Set your vector graphic's artboard/canvas to be as close to the reproduced size as possible. When in doubt as to the final size, go large. With vectors, larger canvases don't take more bytes than small ones, but they'll render nicer, especially in FireFox.
  3. To avoid sub-pixel anti-aliasing between tiled images, make sure your artboard is in whole pixels.
  4. In Illustrator, save as SVG 1.1 and "Clip to artboard!"
  In the CSS and markup!
  Originally I tried to do multiple animated backgrounds, like I've done before with PNGs:
  But the performance was TERRIBLE, especially in FireFox and on my iPhone 4s. Then @askoth made a demo doing the same thing by arranging the background into several div tiles and using translate to animate them upward:

  What happens is that rather than calculating the background CONSTANTLY, the browser is able to "bake" a few tiles and shift them around. This gives us very nearly 60fps in Chrome and makes it look great in Firefox.


              html { height: 100%;}
body { background: #000; height: 100%;}
@keyframes fall {
  0% { 
    transform: translate(0, 0)
  100% {
    transform: translate(0, -900px)

.wrapper {
  background: #5A4F4A;
	margin: 0 auto;
  width: 530px; height: 100%;
  overflow: hidden;
  position: relative;

.tunnel {
  animation: fall 6s linear infinite;
	width: 100%; height: 900px;
		url( 0 0 repeat-y,
		url( 100% 0 repeat-y,
		url( top center repeat-y,
		20px 150px, 
		20px 150px, 
		auto 900px,
		auto auto
  position: absolute;
  left: 0; top: 0;

.tunnel2 {
  top: 900px;

.tunnel3 {
  top: 1800px;