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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                #wrapper
  .tabs{:id => "tab1"}
    .tab
      %input{:type => "radio", :name => "tabs1", :id => "tabs1-1"}
      %label.tab-label{:for => "tabs1-1"} Tab1
      .tab-content
        %h3 Tab1
        da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd
    .tab
      %input{:type => "radio", :name => "tabs1", :id => "tabs1-2"}
      %label.tab-label{:for => "tabs1-2"} Tab2
      .tab-content
        %h3 Tab2
        asddasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sdasdasdasd
    .tab
      %input{:type => "radio", :name => "tabs1", :id => "tabs1-3", :checked => "true"}
      %label.tab-label{:for => "tabs1-3"} Tab3
      .tab-content
        %h3 Tab3
        樣式參考自 <a href="codepen.io/dolbyzerr/pen/wBkLc">codepen.io/dolbyzerr/pen/wBkLc</a> <br />
        asddasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as das
    .tab
      %input{:type => "radio", :name => "tabs1", :id => "tabs1-4"}
      %label.tab-label{:for => "tabs1-4"} Tab4
      .tab-content
        %h3 Tab4
        asddasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasdasd as das d asdasdas da sdasd as da sd asd as dasasdasd
              
            
!

CSS

              
                @import compass

a
  text-decoration: none
  color: #85b2d4

#wrapper
  margin: 50px auto
  width: 600px
  font-size: 14px
  line-height: 20px
  color: #666
  
#tab1
  height: 300px

.tabs
  position: relative

  &:before
    position: absolute
    content: ''
    width: 100%
    height: 5px
    border-top: 1px #e0e0e0 solid
    top: 28px
    left: 0
    background: #FFF
    z-index: 2
  
  .tab
    margin-top: 30px
    float: left
    
    .tab-label
      position: relative
      display: inline-block
      height: 30px
      line-height: 30px
      float: left
      color: #85b2d4
      margin: -30px -5px 0 -5px
      padding: 0 24px
      background: #f7f7f7
      border-top: 1px #e0e0e0 solid
      border-top-left-radius: 6px
      border-top-right-radius: 6px
      cursor: pointer
      z-index: 0
      
      &:before
        content: ' '
        position: absolute
        left: -3px
        top: 3px
        bottom: 2px
        width: 10px
        transform: rotate(14deg)
        border-left: 1px solid #e0e0e0
        background: #f7f7f7
        z-index: -1

      &:after
        content: ''
        position: absolute
        right: -3px
        top: 3px
        bottom: 2px
        width: 10px
        transform: rotate(-14deg)
        border-right: 1px solid #e0e0e0
        background: #f7f7f7
        z-index: -1
    
    &:first-child
      .tab-label
        margin-left: 10px

    .tab-content
      position: absolute
      left: 0
      top: 40px
      bottom: 0
      left: 10px
      right: 10px
      opacity: 0
      z-index: 0
      transition: all 0.5s ease 0s

    input[type=radio]
      display: none

      &:checked
        ~ .tab-label
          color: #666
          z-index: 2
          background: #FFF
          margin-top: -35px
          height: 37px
          line-height: 35px
          
          &:before
            background: #FFF

          &:after
            background: #FFF
        
        ~ .tab-content
          opacity: 1
          z-index: 2
        
              
            
!

JS

              
                
              
            
!
999px

Console