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

              
                html
body.onepage
    section#section-1.section.vertical
      div
        h1 A first section
        |         
        svg.svg(xmlns='http://www.w3.org/2000/svg', width='300', height='300', viewbox='0 0 32 32')
          path(d='M12 20l4-2 14-14-2-2-14 14-2 4zm-2.959 7.097c-.989-2.085-2.052-3.149-4.137-4.137l3.097-8.525 4-2.435 12-12h-6l-12 12-6 20 20-6 12-12v-6l-12 12-2.435 4z', fill='#ffc7c7')
        |         
        p Orders from the menu &amp; by the left and right keys.
    |     
    |     
    section#section-2.section.vertical
      div
        h2 A second section
        |         
        svg.svg(xmlns='http://www.w3.org/2000/svg', width='300', height='300', viewbox='0 0 32 32')
          path(d='M22.423 0c-5.274 8.718-9.447 4.431-15.55 10.701-5.386 5.533-3.518 12.197 1.016 14.492 4.476-2.287 9.055-7.401 12.452-14.804 0 0 3.052 9.348-6.297 18.355 4.54 5.317 12.245 1.618 14.398-6.841 2.341-9.196-3.762-18.559-6.019-21.903zm-19.391 30.195c.004.091.107 1.805 2.355 1.805 1.636 0 9.932-4.521 14.196-16.256-6.451 11.413-15.816 14.245-16.551 14.451z', fill='#a163cc')
        |         
        p Intermediate section...
    |     
    |     
    section#section-3.section.vertical
      div
        h2 A third section
        |         
        svg.svg(xmlns='http://www.w3.org/2000/svg', width='300', height='300', viewbox='0 0 32 32')
          path(d='M14.533 19.422l-10.578-10.578c-5.273 6.086-5.273 15.07 0 21.156l10.578-10.578zm1.467-1.422v-18c-4.906.305-9.328 2.18-12.897 5.102l12.897 12.898zm2.002-13.984v14.812l-10.383 10.383c2.328 1.711 5.133 2.789 8.235 2.789 7.818 0 14.146-6.328 14.146-14.133 0-7.078-5.227-12.812-11.998-13.851z', fill='#cbffc7')
        |         
        p Congratulations, you managed without incident until the last level!
    |     
    |     
    nav.main-nav
      a(href='#section-1') Section 1
      |       
      a(href='#section-2') Section 2
      |       
      a(href='#section-3') Section 3
              
            
!

CSS

              
                html
  scroll-behavior: smooth

.onepage
  & .section
    box-sizing border-box
    min-height 100vh
    margin 0
    padding 1em 2em
    &:nth-child(3n+1)
      color #ffc7c7
      background-color #ba5959
      & *
        color #ffc7c7
        fill #ffc7c7
    &:nth-child(3n+2)
      color #a163cc
      background-color #4b2e5f
      & *
        color #a163cc
        fill #a163cc
    &:nth-child(3n+3)
      color #cbffc7
      background-color #61ba59
      & *
        color #cbffc7
        fill #cbffc7
  & .main-nav
    position fixed
    z-index 4000
    display table
    table-layout fixed
    bottom 0
    text-align center
    background rgba(0, 0, 0, .2)
    @media (max-width: 40em)
        width 100%
    @media (min-width 40em)
        top 0
        right 0
    & a
      display table-cell
      padding 1rem
      color #fefefe
      text-decoration none
      &.active
        background-color rgba(0, 0, 0, 0.3)

// for demo:

@import url(https://fonts.googleapis.com/css?family=Open+Sans)

html
body
  box-sizing border-box
  height:100%
  margin 0
  padding 0
  color #fefefe
  font-family 'Open Sans', Arial

.vertical
  display table
  width 100%
  height 100% // @bugfix @affected Firefox
  & > *
    display table-cell
    vertical-align middle
    text-align center

p
  font-size 1.2em

h1
.h1
  margin-top 1.6em
  margin-bottom 0.8em
  font-size 3.2em

h2
.h2
  margin-top 1.4em
  margin-bottom 0.7em
  font-size 2.8em

@media (max-width 40em)
  
  h1
  .h1
    font-size 9.6vmin

  h2
  .h2
    font-size 7.6vmin

.svg
  display block
  margin 5vh auto 0
  width 100%
  height 100%
  max-width 30wh
  max-height 30vh
              
            
!

JS

              
                // No JS
              
            
!
999px

Console