Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <div id="pong">
  <div class="pad"></div>
  <div class="ball"></div>
  <div class="pad"></div>
</div>
              
            
!

CSS

              
                @import compass

@keyframes pad
  0%
    transform: translate3d(0, 0, 0)
  50%
    transform: translate3d(0, 100px, 0)
  100%
    transform: translate3d(0, 0, 0)

@keyframes ball
  0%
    transform: translate3d(0, 0, 0)
  50%
    transform: translate3d(140px, 100px, 0)
  100%
    transform: translate3d(0, 0, 0)

#pong
  display: block
  margin: 30px
  height: 150px
  width: 200px
  border: 1px solid #000
  box-sizing: border-box
  padding: 0 10px

  &:before
    content: 'pong'
    font-family: monospace
    position: relative
    top: -20px

  .pad
    float: left
    display: block
    width: 5px
    height: 20px
    background-color: #000
    margin-left: 10px
    animation: pad 3s infinite ease-in-out

  .ball
    display: inline-block
    width: 5px
    height: 5px
    float: left
    background-color: #000
    animation: ball 3s infinite linear

  .ball + .pad
    margin-left: 140px
    animation: 3s pad -.5s infinite ease-in
              
            
!

JS

              
                
              
            
!
999px

Console