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="a"></div>
<div class="b"></div>
              
            
!

CSS

              
                div {
  position: relative;   /* 因為虛擬元素要進行絕對定位,父元素需要是 relative */
  width: 150px;
  height: 150px;
  border-radius: 50%;
  margin: 30px;
}
.a {
  background: conic-gradient(
    #fb0 0, 
    #fb0 200deg,
    #f66 0
  );
}
.b {
  background: conic-gradient(
    #f90 0, 
    #f90 50deg,
    #0a0 50deg,
    #0a0 100deg,
    #c5c 100deg,
    #c5c 200deg,
    #0af 200deg,
    #0af 230deg,
    #999 230deg,
    #999 270deg,
    #f66 0
  );
}
div::before {
  content: "";
  position: absolute;        /* 絕對定位 */
  z-index: -1;               /* 位置移動到下層 */
  width: calc(100% + 20px);  /* 尺寸比原本增加 20px */
  height: calc(100% + 20px); /* 尺寸比原本增加 20px */
  top: -10px;                /* 往上移動 10px */
  left: -10px;               /* 往左移動 10px */
  border-radius: 50%;        /* 變成圓形 */
}
.a::before {
  background: conic-gradient(
    #f90 0, 
    #f90 200deg,
    #f33 0
  );
}
.b::before {
  background: conic-gradient(
    #f60 0, 
    #f60 50deg,
    #080 50deg,
    #080 100deg,
    #a3a 100deg,
    #a3a 200deg,
    #08c 200deg,
    #08c 230deg,
    #666 230deg,
    #666 270deg,
    #f33 0
  );
}
              
            
!

JS

              
                
              
            
!
999px

Console