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

              
                <nav>Sticky Nav Yo!</nav>

<div class="container one">
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste cum error fuga ab quia quasi porro earum soluta ipsum repudiandae accusamus ducimus perspiciatis dolor sapiente facere ea dicta dolore vitae!</p>
</div>
<div class="container fake-nav">
  Sticky Nav Yo!
</div>

<div class="container two">
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste cum error fuga ab quia quasi porro earum soluta ipsum repudiandae accusamus ducimus perspiciatis dolor sapiente facere ea dicta dolore vitae!</p>  
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste cum error fuga ab quia quasi porro earum soluta ipsum repudiandae accusamus ducimus perspiciatis dolor sapiente facere ea dicta dolore vitae!</p>  
</div>
<div class="container three">
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste cum error fuga ab quia quasi porro earum soluta ipsum repudiandae accusamus ducimus perspiciatis dolor sapiente facere ea dicta dolore vitae!</p>  
</div>
<div class="container four">
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corporis facilis eaque eligendi fuga illo accusantium voluptate consequatur est natus beatae minima repellat earum impedit commodi nihil! Soluta sit nemo doloribus.</p>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corporis facilis eaque eligendi fuga illo accusantium voluptate consequatur est natus beatae minima repellat earum impedit commodi nihil! Soluta sit nemo doloribus.</p>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corporis facilis eaque eligendi fuga illo accusantium voluptate consequatur est natus beatae minima repellat earum impedit commodi nihil! Soluta sit nemo doloribus.</p>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corporis facilis eaque eligendi fuga illo accusantium voluptate consequatur est natus beatae minima repellat earum impedit commodi nihil! Soluta sit nemo doloribus.</p>
</div>

              
            
!

CSS

              
                // reset
p {margin: 0}

// basic coloring & styling for demo purposes
.container {
  color: white;
  font-size: 48px; // makes fluid height containers taller for demo
  padding: 48px;
}

.one {background: rgba(darken(red, 20%), 0.95);}
.two {background: rgba(darken(green, 20%), 0.5);}
.three {background: rgba(darken(gold, 10%), 0.5);}
.four {background: rgba(darken(navy, 10%), 0.95);}

nav, .fake-nav {
  background: orange;
  color: white;
  padding: 20px 0;
  text-align: center;
  width: 100%;
  font-size: 48px;
}


// Required Styles

.container {position: relative;} // required for z-index

.one, .four, .fake-nav {z-index: 1000;}
.two, .three {z-index: 100;}

nav {
  position: fixed;
  z-index: 500;
}
              
            
!

JS

              
                
              
            
!
999px

Console