Pen Settings



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


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


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.


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.


                <span id="ball"></span>
  <span id="moveMe">Animation</span>
  <div class="transition">Transition</div>
  <div class="user-img"></div>

Common transforms:
transform: scale(2, 0.5);
transform: scaleX(2);
transform: scaleY(0.5);
transform: rotate(0.5turn);
transform: translateZ(2px);
transform: scale3d(2.5, 1.2, 0.3);
transform: scaleZ(0.3);
transform: rotate3d(1, 2.0, 3.0, 10deg);
transform: rotateX(10deg);
transform: rotateY(10deg);
transform: rotateZ(10deg);
transform: perspective(17px);


                * {box-sizing: border-box;}
body { 
  font-family: arial;
  background: #444;
  color: #ccc;
section {
  width: 200px;
  display: block;
  position: absolute;
.transition {
  border: 5px solid #333;
  text-align: center;
  height: 5em;
  width: 6em;
  line-height: 4.5em;
  background: #666;
  opacity: .5;
  margin: 1em 1em 0 15em;
  // No commas between transforms
  transform: scale(1.2) ; // Transform simply applied
  transform-origin: center center; 
    line-height .5s,
    color .5s, 
    width .5s, 
    height .5s, 
    background .5s, 
    transform .5s, // Looks at transform property and applies over time
    opacity .5s, 
  &:hover {
    color: #444;
    opacity: .5;
    background: #ccc;
    width: 8em;
    height: 8em;
    line-height: 7em;
    // Something I want the element to do when hovered.
    // Without the transition property specifying it over time,
    // it would just be applied immediately
    transform: rotate(-5deg);
// Transform triggered with a JS onclick event
  border: 5px solid #333;
  border-radius: 50px;
  width: 50px;
  height: 50px;
  background: #666;
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 1s; 

// CSS Animations: create your animation
// use transforms for positioning, it creates a new
// stacking context and allows the browser to use the GPU
@keyframes play {
   0%   { transform: translate(50px, 0); opacity: 0; }
   25%  { transform: translate(100px, 0); }
   50%  { transform: translate(100px, 50px); opacity: 1;}
   75%  { transform: translate(100px, 0); }
   100% { transform: translate(50px, 0); opacity: 0;}
#moveMe {
  // call your animation by name
  animation: play 2s infinite;
  border: 5px solid #333;
  background: #666;
  padding: 1em;
  position: absolute;

// Animating clip-path
.user-img {
  transition: clip-path .5s ease, opacity .5s ease;
  clip-path: circle(10%);
  background-image: url(;
  background-postition:  left -30px top -50px;
  background-size: 100%;
  background-repeat: no-repeat;
  height: 200px;
  width: 200px;
  margin-left: 23em;
  opacity: .2;
  &:hover {
    clip-path: circle(50%);
    opacity: 1;



                var b = document.getElementById('ball');
document.addEventListener('click', function(ev){ = 'translateY('+(ev.clientY-25)+'px)'; += 'translateX('+(ev.clientX-25)+'px)';