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

              
                <main>
  <nav>
    <a href="#cover"><h3>Cover</h3></a>
    <a href="#section-one"><h3>One</h3></a>
    <a href="#section-two"><h3>Two</h3></a>
    <a href="#section-three"><h3>Three</h3></a>
  </nav>
  <section id="cover" class="cover">
    <h1>Cover</h1>
    <p>Scroll</p>
  </section>
  <section id="section-one" class="content">
    <div>
      <h2>Section One</h2>
      <img src="http://placekitten.com/1280/600" />
      <p>Dolorem rerum et aspernatur inventore quasi et quod doloremque exercitationem sunt adipiscing facilis possimus minus labore exercitationem aspernatur ipsam voluptatibus excepturi nihil! Voluptatem dolores id accusantium temporibus assumenda et atque unde consectetur fugit sit qui voluptas fugit dolore nihil quidem tempore consequuntur similique reprehenderit et rerum. Velit corporis consequatur nesciunt est corporis et qui quod. Recusandae qui consequatur itaque inventore hic molestiae labore dolores rerum veniam culpa dolorem velit in molestiae voluptatem. Non sed quod animi excepturi sapiente obcaecati quod.</p>
    </div>
  </section>
  <section id="section-two" class="content">
    <div>
      <h2>Section Two</h2>
      <img src="http://placekitten.com/1180/500" />
      <p>Dolorem rerum et aspernatur inventore quasi et quod doloremque exercitationem sunt adipiscing facilis possimus minus labore exercitationem aspernatur ipsam voluptatibus excepturi nihil! Voluptatem dolores id accusantium temporibus assumenda et atque unde consectetur fugit sit qui voluptas fugit dolore nihil quidem tempore consequuntur similique reprehenderit et rerum. Velit corporis consequatur nesciunt est corporis et qui quod. Recusandae qui consequatur itaque inventore hic molestiae labore dolores rerum veniam culpa dolorem velit in molestiae voluptatem. Non sed quod animi excepturi sapiente obcaecati quod.</p>
    </div>
  </section>
  <section id="section-three" class="content">
    <div>
      <h2>Section Three</h2>
      <img src="http://placekitten.com/980/450" />
      <p>Dolorem rerum et aspernatur inventore quasi et quod doloremque exercitationem sunt adipiscing facilis possimus minus labore exercitationem aspernatur ipsam voluptatibus excepturi nihil! Voluptatem dolores id accusantium temporibus assumenda et atque unde consectetur fugit sit qui voluptas fugit dolore nihil quidem tempore consequuntur similique reprehenderit et rerum. Velit corporis consequatur nesciunt est corporis et qui quod. Recusandae qui consequatur itaque inventore hic molestiae labore dolores rerum veniam culpa dolorem velit in molestiae voluptatem. Non sed quod animi excepturi sapiente obcaecati quod.</p>
    </div>
  </section>
</main>

              
            
!

CSS

              
                @import "compass"

$color-active: rgba( 255 , 55 , 71 , 1 )
$color-white: rgba( 245 , 250 , 255 , 1 )
$color-black: rgba( 5 , 15 , 30 , 1 )
$sans: 'Titillium Web', sans-serif

html , body
  position: relative
  width: 100%
  
html
  background-color: $color-white
  overflow-x: hidden
  height: 100%
  font-size: 0
  
body
  overflow: hidden
  
section
  @include contain( padding-top , 5vw , 15px , 60px )
  background-color: shade( $color-white , 5% )
  position: relative
  display: block
  
  &:last-of-type
    @include contain( padding-bottom , 5vw , 15px , 60px )
  
.cover
  height: 100vh
  box-sizing: border-box
  background-color: $color-active
  z-index: 3
  
  h1
    @include translate( -50% , -50% )
    @include contain( padding , 5vw , 15px , 60px )
    background-color: $color-white
    line-height: 75%
    color: $color-active
    display: inline-block
    position: absolute
    left: 50%
    top: 50%
    
  p
    @include contain( padding , 2vw , 10px , 20px )
    @include contain( bottom , 2vw , 10px , 20px )
    color: $color-white
    position: absolute
    box-sizing: border-box
    width: 100%
    text-align: center
    
    &:before
      content: ""
      @include contain( bottom , 1vw , 0 , 10px )
      position: absolute
      left: 50%
      border-top: 6px solid $color-white
      border-left: 6px solid transparent
      border-right: 6px solid transparent
      margin-left: -6px
  
.content
  z-index: 1
  text-align: center
  
  div
    background-color: $color-white
    @include contain( padding-top , 5vw , 15px , 60px )
    box-sizing: border-box
    display: inline-block
    text-align: left
    max-width: 100%
    width: 900px
    
    h2 , img , p , hr
      @include contain( margin-bottom , 5vw , 15px , 60px )
      
    img
      &:last-child

        // need to modify the contain mixin to use a selector?
        // idk, but using important or making a second include
        // to reset for cases like this is not ideal 
        margin-bottom: 0 !important
      
    h2 , p
      @include contain( padding-right , 5vw , 15px , 60px )
      @include contain( padding-left , 5vw , 15px , 60px )
      
    img
      @include transition( opacity 0.3s ease-in-out )
      opacity: 0.95
      width: 100%
      height: auto
      
      &:hover
        opacity: 1
  
nav
  @include contain( padding , 5vw , 10px , 40px )
  background-color: $color-black
  position: fixed
  text-align: center
  z-index: 2
  right: 0
  left: 0
  top: 0
  
  a
    @include contain( padding , 4vw , 3px , 20px )
    padding-top: 0 !important
    padding-bottom: 0 !important
    display: inline-block
    color: $color-white
    text-decoration: none
    text-transform: uppercase
    
    border-left: 1px solid tint( $color-black , 33% )
    border-left: 1px solid tint( $color-black , 33% )
    
    &:first-of-type
      border-left: none
    
  
h1 , h2 , h3 , p
  letter-spacing: 0.05em
  line-height: 135%
  font-family: $sans
  
h1 , h3
  text-transform: uppercase
  
h1
  @include contain( font-size , 12vw , 30px , 120px )
  color: $color-active
  
h2
  @include contain( font-size , 10vw , 20px , 70px )
  text-align: center
  color: $color-active
  
p
  @include contain( font-size , 4vw , 14px , 21px )
  
h3
  @include contain( font-size , 4vw , 10px , 15px )
              
            
!

JS

              
                
              
            
!
999px

Console