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 id="stopwatch">
  <span class="ms"></span>
</div>
              
            
!

CSS

              
                /* 自訂屬性 */
@property --ms {
  syntax: "<integer>";
  inherits: false;
  initial-value: 0;
}
#stopwatch {
  --state: paused;            /* 自訂變數 --state 預設值 paused */
  font-size: 100px;
}

#stopwatch:hover {
  --state: running;           /* hover 時改變變數 --state 為 running */
}
.ms {
  counter-reset: count-ms  var(--ms);  /* 設定計數器名稱 count-ms,數值為 --ms 數值 */
  animation:  oxxo-ms 1s steps(10) var(--state) infinite; /* 使用 steps 方式播放動畫 */
}
.ms::before {
  content: counter(count-ms); /* 虛擬元素顯示 count-ms 計數器數值 */
}
@-webkit-keyframes oxxo-ms {
  to {
    --ms: 10;                 /* 動畫結束點為數值為 10 的自訂屬性 --ms  */
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console