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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

              
                .container
  div
    input#custom-checkbox.custom-checkbox(type="checkbox")
    label(for="custom-checkbox") 自定勾選按鈕
  hr
  div
    input#custom-radio-a.custom-radio(type="radio", name="custom-radio")
    label(for="custom-radio-a") 自定radio按鈕a
    input#custom-radio-b.custom-radio(type="radio", name="custom-radio")
    label(for="custom-radio-b") 自定radio按鈕b
    input#custom-radio-c.custom-radio(type="radio", name="custom-radio")
    label(for="custom-radio-c") 自定radio按鈕c
              
            
!

CSS

              
                .container
  padding: 1rem

.custom-checkbox, .custom-radio
  // 要移除預設的勾勾方塊,不能用display:none,因為這樣會在用tab鍵選位置時選不到
  // 要改用以下方式。clip是切片,四個數值是上、右、下、左,設定要切出多少範圍,0,0,0,0代表切一個0的範圍出來
  position: absolute
  clip: rect(0,0,0,0)
  + label::before
    content: '\a0' // before不會產生空格
    display: inline-block
    margin-right: .2rem
    width: .8rem
    height: .8rem
    text-indent: .15rem // 首行縮徘
    line-height: .8

.custom-checkbox
  + label::before
    background: silver
    border-radius: .2rem
  &:checked + label::before
    content: '\2713'
    background: yellowgreen
 
.custom-radio
  + label::before
    background: silver
    border-radius: 50%
  &:checked + label::before
    content: '\2713'
    background: yellowgreen
              
            
!

JS

              
                
              
            
!
999px

Console