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

              
                .header-bar
.header-back
.header-front
  .tabs
    a.tab[href="#"] Home
    a.tab[href="#"] Stuff and Stuff
    a.tab[href="#"] Tacos
    a.tab[href="#"] Food
    a.tab[href="#"] About Us
    a.tab[href="#"] Home
    a.tab[href="#"] Stuff and Stuff
    a.tab[href="#"] Tacos
    a.tab[href="#"] Food
    a.tab[href="#"] About Us
.header Header

.scroll-left
.scroll-right
              
            
!

CSS

              
                .scroll-left, .scroll-right
  width 32px
  height 56px
  background blue
  display inline-block
  position absolute
  top 136px
.scroll-left
  left calc(40% - 8px)
.scroll-right
  right 8px

::selection
  background #3ac
  color white

@media (cursor: pointer)
  ::-webkit-scrollbar
    width 12px
    background #eee
  ::-webkit-scrollbar-thumb
    background #aaa
    &:hover
      background #999

body
  margin 0
  height 400vh
  font-family sans-serif
  position relative

.header-back
  width 100%
  height 76px
  background #ddd
  position fixed
  top 0
  left 0
  border-bottom 4px solid #333
  box-shadow 0 0 20px rgba(black, .5)

.header
    height 76px
    background #ddd
    position fixed
    top 0
    left 0
    color #444
    font-size 3em
    box-sizing border-box
    padding 12px 20px 0 20px

.header-front
  width 100%
  height 200px
  background #ddd
  position absolute
  top 0
  left 0
  .tabs
    height 56px
    width 60%
    margin 8px
    background #ccc
    float right
    position absolute
    top 128px
    right 0
    overflow-x auto
    //overflow-y hidden
    white-space nowrap
    box-sizing border-box
    padding 0 32px
    &::-webkit-scrollbar
      display none
      //height 100%
    &::-webkit-scrollbar-corner, &::-webkit-scrollbar-track, &::-webkit-scrollbar-thumb, &::-webkit-scrollbar:vertical
      display none
      opacity 0
      background rgba(0,0,0,0)
      height 0
    &::-webkit-scrollbar-button
      width 32px
      height 100%
      background blue
    .tab
      display inline-block
      min-width none
      width auto
      color #666
      font-size 24px
      padding 14px
      transition all .2s
      text-decoration none
      &:hover
        color white
      &:nth-child(5n-4):hover
        background #4ac
        box-shadow 0 -4px darken(@background, 8) inset
      &:nth-child(5n-3):hover
        background #7a3
        box-shadow 0 -4px darken(@background, 8) inset
      &:nth-child(5n-2):hover
        background #e70
        box-shadow 0 -4px darken(@background, 8) inset
      &:nth-child(5n-1):hover
        background #a3c
        box-shadow 0 -4px darken(@background, 8) inset
      &:nth-child(5n):hover
        background #37c
        box-shadow 0 -4px darken(@background, 8) inset

.header-bar
  width 100%
  height 200px
  box-shadow 0 4px 0 #333
              
            
!

JS

              
                $("div.tabs").scrollLeft(500);
              
            
!
999px

Console