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.


                <h1 id="test">Dissecting Transforms</h1>
<p>Drop in a CSS3 transform stack and see how it gets created. Then rearrange and try again. This is especially useful when working with <code>translate</code> and <code>rotate</code> functions or when you are working in 3D.</p>

  <p>Unfortunately, this tool requires JavaScript.</p>


                body {
  padding: 1em;
  -webkit-perspective: 500px;
  perspective: 500px;
label {
  font-weight: bold;
textarea {
  display: block;
  margin:.5em 0;
  height: 200px;
button {
  margin-right: .5em;
p {
.target {
				background: #ccc;
				border: 5px solid;
				border-radius: 10px;
				color: #000;
				width: 190px;
				height: 190px;
				margin: -100px 0 0 -100px;
				position: absolute;
				top: 50%;
				left:  50%;
				   -moz-transition:    -moz-transform 1s, opacity 1s;
				    -ms-transition:     -ms-transform 1s, opacity 1s;
				-webkit-transition: -webkit-transform 1s, opacity 1s;
				     -o-transition:      -o-transform 1s, opacity 1s;
				        transition:         transform 1s, opacity 1s;


  var transforms = [],
    stack = '',
    $body = $('body'),
    $target = $('<div class="target"/>'),
    $current_target = $([]),
    $form = $('<div id="form"/>'),
    $label = $('<label for="transform">Transform Stack</label>').appendTo($form),
    $transform = $('<textarea id="transform">translateX(50px) rotate(45deg) translateY(80px)</textarea>')
    $button = $('<button>Show Me</button>')
            $form.appendTo( $body )
    $rearrange = $('<button>Rearrange</button>')

  function apply()
    if ( $current_target.length )
    transforms = $transform.val().replace(/[\s\r\n]+/g,' ').split(' ');
    stack = '';
    $current_target = $target.clone().appendTo( $body );
    interval = setInterval(transform,1000);

  function transform(){
    if ( transforms.length )
      stack += '' + transforms.shift();
           '-moz-transform': stack,
            '-ms-transform': stack,
        '-webkit-transform': stack,
             '-o-transform': stack,
                'transform': stack
  function rearrange()
    var array = $transform.val().replace(/[\s\r\n]+/g,' ').split(' '),
        index = array.length,

    // While there remain elements to shuffle...
    while ( 0 !== index )
      // Pick a remaining element...
      random = Math.floor(Math.random() * index);
      index -= 1;

      // And swap it with the current element.
      temp = array[index];
      array[index] = array[random];
      array[random] = temp;

    $transform.val( array.join(' ') );