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

              
                <pre>svg .cat {
  animation: spin 5s linear infinite;
  transform-origin: 50% 50%;
}</pre>

<svg width="465" viewBox="0 0 300 74"><path class="cat" d="M19.1 0a3 3 0 0 0-2.3 1.5C9.8 13.5 4.4 26 4.3 41.3a16.4 16.4 0 0 0-4.3.8L.6 44a15.6 15.6 0 0 1 3.7-.7 31 31 0 0 0 .4 4l-1.9.8 1 1.8 1.3-.6.6 2.1a19.5 19.5 0 0 0-2.1 2L5 54.6l1.4-1.3A33.3 33.3 0 0 0 37 74h12c13.7 0 26.1-8.3 30.8-20.4l1.3 1.1 1.4-1.4a22 22 0 0 0-2-1.8l.6-2.2 1.2.6.8-1.8c-.4-.2-1-.6-1.7-.8a31.7 31.7 0 0 0 .3-4 15.2 15.2 0 0 1 3.7.7l.6-2a16.6 16.6 0 0 0-4.3-.7C81.3 25.5 75 15.1 69.3 3.7a3 3 0 0 0-5.2-.1L59 12.8a123.2 123.2 0 0 0-31-1L21.9 1.6A3 3 0 0 0 19.1 0zm3 13.7l1.7 2.8a3 3 0 0 0 2.3 1.5c-.2 4.7 1.4 12.1 6 12 4-.1 5.7-4.2 6.4-7.5.6 2.9 2.7 5.4 5.5 5.5 3.9 0 5.3-3 6.1-6 .2 3.6 1.8 8 5.9 8 5.8 0 6.6-7.3 6.8-12a29 29 0 0 0 2.2-3.8 10.3 10.3 0 0 0-.2 1.8 3 3 0 0 0 1.7 2.7 9.8 9.8 0 0 0 4.1 1.1 54.7 54.7 0 0 1 5.1 21.8l-2.2.4.5 2c.6-.1 1.1-.3 1.7-.3l-.1 2.2a15 15 0 0 0-2 .2l.3 2a10.6 10.6 0 0 1 1.3-.2c0 .5-.2.9-.3 1.3l-1-.2-.3 2 .7.1A26.7 26.7 0 0 1 49 68H37a27.3 27.3 0 0 1-25.1-17h.4l-.2-2-.9.1L11 48l1.1.1.3-2a14.9 14.9 0 0 0-1.8-.1l-.2-2.3 1.6.3.6-1.9a22.5 22.5 0 0 0-2.3-.4 61.4 61.4 0 0 1 5.1-23.8 9 9 0 0 0 5.2-1.1 3.5 3.5 0 0 0 1.6-3zm3 16.3c-1 0-2 1.8-2 4s1 4 2 4 2-1.8 2-4-.9-4-2-4zM61 30c-1.1 0-2 1.8-2 4s.9 4 2 4 2-1.8 2-4-.9-4-2-4zM43 41c-1.6 0-3 .9-3 2a1.8 1.8 0 0 0 1 1.5v4.6a5.3 5.3 0 0 1-3 1.3c-1.4-.3-1.8-1.7-2-2.7a2 2 0 0 0-1.9-1.7 2 2 0 0 0-2 2.4c.6 3 2.4 5.7 5.5 6a8 8 0 0 0 5.4-1.8 8 8 0 0 0 5.4 1.8c3.3-.5 5-3.2 5.5-6a2 2 0 0 0-2-2.4 2 2 0 0 0-1.9 1.7 3 3 0 0 1-2 2.7 5.3 5.3 0 0 1-3-1.3v-4.6a1.8 1.8 0 0 0 1-1.5c0-1.1-1.4-2-3-2z"/></svg>

<pre>svg .cat {
  animation: spin 5s linear infinite;
  transform-origin: 50% 50%;
  <strong>transform-box: fill-box;</strong>
}</pre>

<svg width="465" viewBox="0 0 300 74"><path class="cat origin" d="M19.1 0a3 3 0 0 0-2.3 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.1 0-2 1.8-2 4s.9 4 2 4 2-1.8 2-4-.9-4-2-4zM43 41c-1.6 0-3 .9-3 2a1.8 1.8 0 0 0 1 1.5v4.6a5.3 5.3 0 0 1-3 1.3c-1.4-.3-1.8-1.7-2-2.7a2 2 0 0 0-1.9-1.7 2 2 0 0 0-2 2.4c.6 3 2.4 5.7 5.5 6a8 8 0 0 0 5.4-1.8 8 8 0 0 0 5.4 1.8c3.3-.5 5-3.2 5.5-6a2 2 0 0 0-2-2.4 2 2 0 0 0-1.9 1.7 3 3 0 0 1-2 2.7 5.3 5.3 0 0 1-3-1.3v-4.6a1.8 1.8 0 0 0 1-1.5c0-1.1-1.4-2-3-2z"/></svg>

<p>Method for browsers that don't support transform-box:</p>

<pre>@keyframes spin-workaround {
  from {
    transform: translate(43px, 37px) rotate(0deg) translate(-43px, -37px);
  }
  to {
    transform: translate(43px, 37px) rotate(360deg) translate(-43px, -37px);
  }
}

.workaround {
  animation: spin-workaround 5s linear infinite;
  transform-origin: 0 0;
}</pre>

<svg width="465" viewBox="0 0 300 74"><path class="cat workaround" d="M19.1 0a3 3 0 0 0-2.3 1.5C9.8 13.5 4.4 26 4.3 41.3a16.4 16.4 0 0 0-4.3.8L.6 44a15.6 15.6 0 0 1 3.7-.7 31 31 0 0 0 .4 4l-1.9.8 1 1.8 1.3-.6.6 2.1a19.5 19.5 0 0 0-2.1 2L5 54.6l1.4-1.3A33.3 33.3 0 0 0 37 74h12c13.7 0 26.1-8.3 30.8-20.4l1.3 1.1 1.4-1.4a22 22 0 0 0-2-1.8l.6-2.2 1.2.6.8-1.8c-.4-.2-1-.6-1.7-.8a31.7 31.7 0 0 0 .3-4 15.2 15.2 0 0 1 3.7.7l.6-2a16.6 16.6 0 0 0-4.3-.7C81.3 25.5 75 15.1 69.3 3.7a3 3 0 0 0-5.2-.1L59 12.8a123.2 123.2 0 0 0-31-1L21.9 1.6A3 3 0 0 0 19.1 0zm3 13.7l1.7 2.8a3 3 0 0 0 2.3 1.5c-.2 4.7 1.4 12.1 6 12 4-.1 5.7-4.2 6.4-7.5.6 2.9 2.7 5.4 5.5 5.5 3.9 0 5.3-3 6.1-6 .2 3.6 1.8 8 5.9 8 5.8 0 6.6-7.3 6.8-12a29 29 0 0 0 2.2-3.8 10.3 10.3 0 0 0-.2 1.8 3 3 0 0 0 1.7 2.7 9.8 9.8 0 0 0 4.1 1.1 54.7 54.7 0 0 1 5.1 21.8l-2.2.4.5 2c.6-.1 1.1-.3 1.7-.3l-.1 2.2a15 15 0 0 0-2 .2l.3 2a10.6 10.6 0 0 1 1.3-.2c0 .5-.2.9-.3 1.3l-1-.2-.3 2 .7.1A26.7 26.7 0 0 1 49 68H37a27.3 27.3 0 0 1-25.1-17h.4l-.2-2-.9.1L11 48l1.1.1.3-2a14.9 14.9 0 0 0-1.8-.1l-.2-2.3 1.6.3.6-1.9a22.5 22.5 0 0 0-2.3-.4 61.4 61.4 0 0 1 5.1-23.8 9 9 0 0 0 5.2-1.1 3.5 3.5 0 0 0 1.6-3zm3 16.3c-1 0-2 1.8-2 4s1 4 2 4 2-1.8 2-4-.9-4-2-4zM61 30c-1.1 0-2 1.8-2 4s.9 4 2 4 2-1.8 2-4-.9-4-2-4zM43 41c-1.6 0-3 .9-3 2a1.8 1.8 0 0 0 1 1.5v4.6a5.3 5.3 0 0 1-3 1.3c-1.4-.3-1.8-1.7-2-2.7a2 2 0 0 0-1.9-1.7 2 2 0 0 0-2 2.4c.6 3 2.4 5.7 5.5 6a8 8 0 0 0 5.4-1.8 8 8 0 0 0 5.4 1.8c3.3-.5 5-3.2 5.5-6a2 2 0 0 0-2-2.4 2 2 0 0 0-1.9 1.7 3 3 0 0 1-2 2.7 5.3 5.3 0 0 1-3-1.3v-4.6a1.8 1.8 0 0 0 1-1.5c0-1.1-1.4-2-3-2z"/></svg>

<p>Or use SVG within SVG:</p>


<svg width="465" viewBox="0 0 300 74"><svg width="86" height="74"><path class="cat workaround2" d="M19.1 0a3 3 0 0 0-2.3 1.5C9.8 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.8-2 4s.9 4 2 4 2-1.8 2-4-.9-4-2-4zM43 41c-1.6 0-3 .9-3 2a1.8 1.8 0 0 0 1 1.5v4.6a5.3 5.3 0 0 1-3 1.3c-1.4-.3-1.8-1.7-2-2.7a2 2 0 0 0-1.9-1.7 2 2 0 0 0-2 2.4c.6 3 2.4 5.7 5.5 6a8 8 0 0 0 5.4-1.8 8 8 0 0 0 5.4 1.8c3.3-.5 5-3.2 5.5-6a2 2 0 0 0-2-2.4 2 2 0 0 0-1.9 1.7 3 3 0 0 1-2 2.7 5.3 5.3 0 0 1-3-1.3v-4.6a1.8 1.8 0 0 0 1-1.5c0-1.1-1.4-2-3-2z"/></svg></svg>
              
            
!

CSS

              
                .cat {
  animation: spin 5s linear infinite;
  transform-origin: 50% 50%;
}

.origin {
  transform-box: fill-box;
}

.workaround {
  animation: spin-workaround 5s linear infinite;
  transform-origin: 0 0;
}

.workaround2 {
  transform-origin: 43 37;
}


html {
  font-family: sans-serif;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

pre {
  font-size: 1.7rem;
}

svg {
  background: #ddd;
}

@keyframes spin-workaround {
  from {
    transform: translate(43px, 37px) rotate(0deg) translate(-43px, -37px);
  }
  to {
    transform: translate(43px, 37px) rotate(360deg) translate(-43px, -37px);
  }
}


              
            
!

JS

              
                
              
            
!
999px

Console