Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's 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 it's URL and the proper URL extention.

+ 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

Save Automatically?

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="btn-primary">
  <div class="span">
    若您想要使用範例,可自由切換 CSS Preprocessor 的 SCSS 與 Sass,以及 CSS 區域的 Sass / SCSS 範例哦! 
  </div>
</div>
<p>By <a href="https://guiblogs.com/">Gui Blog - 網站的工具人</a></p>
              
            
!

CSS

              
                // Sass 範例
/*$primary: red // $變數名稱: 設定值
$font-sm: 14px
.btn-primary
	border: 1px solid $primary // 設定框線為 1px 大小的紅色實線
	color: $primary // 設定文字顏色為紅色
.span
	font-size: $font-sm // 設定字體大小為 14px*/

// SCSS 範例
$primary: blue; // $變數名稱: 設定值;
$font-xl: 20px;
.btn-primary {
    border: 1px solid $primary; // 設定框線為 1px 大小的藍色實線
    color: $primary; // 設定文字顏色為藍色
}
.span {
    font-size: $font-xl; // 設定字體大小為 20px
}
              
            
!

JS

              
                
              
            
!
999px

Console