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

              
                <div class="container">
  <div class="cube"></div>
</div>
              
            
!

CSS

              
                .container {
  margin: 20px;
  padding: 20px;
  transform-style: preserve-3d; // 要設定瀏覽器才會 3D 呈現,否則預設是 flat
  width: 100px; // 標註 width 和 border 只是標示出 container, 幫助看見效果變化
  border: 1px dashed #525252;
  // 轉一下 container 方向,再修改一下視角,才會看得更明顯
  transform: rotate3d(200, -200, 5, 50deg);
  perspective: 300px;
}

.cube {
  width: 100px;
  height: 100px;
  background: #41D2F2;
  transition: transform 1s;
  &.move {
    transform: translate3d(25px, 50px, 25px);
  }
}

              
            
!

JS

              
                setInterval(function(){ 
  $('.cube').toggleClass('move')
}, 1000);
              
            
!
999px

Console