cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmloctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <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>
            
          
!
            
              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;
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console