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

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

              
                <div>Pseudo Element Animation & Transition Tests</div>

<a id="animate" href="#">Animation Test</a>

<a id="transition" href="#">Transition Test (please hover or focus)</a>
              
            
!

CSS

              
                a {
 display: block;
 border: 1px solid black;
 margin: 20px;
 padding: 20px;
 text-align: center;
 font: bold 18px Sans-Serif;
 color: #ccc;
 position: relative;
}
a:first-child {
  border: 0;
  color: black; 
}

#animate:before, 
#transition:before {
 content: "";
 position: absolute;
 left: 0;
 top: 0;
 width: 20px;
 height: 100%;
 background: red; 
}

#transition:before {
  -webkit-transition: all 0.3s ease-out;
  -moz-transition: all 0.3s ease-out;
  -ms-transition: all 0.3s ease-out;
  -o-transition: all 0.3s ease-out;
  transition: all 0.3s ease-out;
}
#transition:hover,
#transition:focus {
  /* things won't work in IE 10 without this declaration */
}
#transition:hover:before,
#transition:focus:before {
 left: 100%;
 margin-left: -20px;
 background: green;
}

@keyframes move {
 0% { 
   left: 0;
   margin-left: 0;
   background: red;
 }
 100% {
   left: 100%;
   margin-left: -20px;
   background: green;
 }
}

#animate:before {
  -webkit-animation: move 5s ease alternate infinite;
  -moz-animation: move 5s ease alternate infinite;
  -ms-animation: move 5s ease alternate infinite;
  -o-animation: move 5s ease alternate infinite;
  animation: move 5s ease alternate infinite;
}
              
            
!

JS

              
                
              
            
!
999px

Console