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

              
                  
<header>
  <h1>Thanksgiving 101</h1>
  <nav>
  <a href="#">Turkey</a>
  <a href="#">Gravy</a>
  <a href="#">Mashed Potato</a>
  <a href="#">Stuffing</a>
</nav>
</header>
<div class="content">
  <h3>Sticky Navigation Example</h3>
  <p>The navbar will stick to the top when you reach its scroll position.</p>
  <p>The best thing about Thankgiving has to be the stuffing.  This is my favorite part.  We always eat to late in the day for my tastes.  Someday I'd like to have the meal at 2pm, then watch some football.  That would be a nice Thanksgiving.</p>
  <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Recusandae et temporibus nulla nobis doloribus! Magnam temporibus beatae incidunt rerum. Ipsum dolorem omnis laudantium harum et voluptates, ab odit assumenda fugiat praesentium iusto magni reprehenderit delectus sit impedit mollitia quas exercitationem ea. Eaque quo nemo pariatur aut sint. Quasi magni ab quam mollitia totam molestias eveniet. Omnis eligendi, nam enim quo explicabo officia doloribus necessitatibus sapiente cum accusantium similique doloremque commodi voluptatem non harum in unde voluptatibus eos maiores accusamus tempora molestias! Nisi, perspiciatis laboriosam ab tempore qui rerum officia dicta consectetur maxime eaque nemo aliquam quasi corporis facere fuga saepe sapiente pariatur nesciunt quia est illo alias. Perferendis optio eaque deleniti, explicabo, blanditiis rerum harum provident in ea, aliquid nulla!</p>
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit recusandae eaque molestias officia quidem aliquam hic accusamus veritatis dolorum vero blanditiis cupiditate sint cum esse quia iure, adipisci voluptatibus reprehenderit voluptatem at, in quisquam. Numquam hic ullam deserunt soluta consequatur recusandae laborum, repellendus nihil dicta ipsam fugit impedit! Laudantium incidunt blanditiis quam optio sunt, expedita temporibus placeat ducimus tempore odio vero alias asperiores officia. Laborum odit earum ab consequatur eius, repudiandae dolorem saepe quam nisi iste nostrum ut vel error?</p>
  <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Recusandae et temporibus nulla nobis doloribus! Magnam temporibus beatae incidunt rerum. Ipsum dolorem omnis laudantium harum et voluptates, ab odit assumenda fugiat praesentium iusto magni reprehenderit delectus sit impedit mollitia quas exercitationem ea. Eaque quo nemo pariatur aut sint. Quasi magni ab quam mollitia totam molestias eveniet. Omnis eligendi, nam enim quo explicabo officia doloribus necessitatibus sapiente cum accusantium similique doloremque commodi voluptatem non harum in unde voluptatibus eos maiores accusamus tempora molestias! Nisi, perspiciatis laboriosam ab tempore qui rerum officia dicta consectetur maxime eaque nemo aliquam quasi corporis facere fuga saepe sapiente pariatur nesciunt quia est illo alias. Perferendis optio eaque deleniti, explicabo, blanditiis rerum harum provident in ea, aliquid nulla!</p>
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit recusandae eaque molestias officia quidem aliquam hic accusamus veritatis dolorum vero blanditiis cupiditate sint cum esse quia iure, adipisci voluptatibus reprehenderit voluptatem at, in quisquam. Numquam hic ullam deserunt soluta consequatur recusandae laborum, repellendus nihil dicta ipsam fugit impedit! Laudantium incidunt blanditiis quam optio sunt, expedita temporibus placeat ducimus tempore odio vero alias asperiores officia. Laborum odit earum ab consequatur eius, repudiandae dolorem saepe quam nisi iste nostrum ut vel error?</p>
              
            
!

CSS

              
                nav {
  display:flex;
  flex-direction:column;
  flex-wrap:wrap;
  justify-content:center;
  height:50px;
  padding-top:20px;
}
header{
  background-color:#efefef;
  position:sticky;
  top:0;
}
nav a {
  text-decoration:none;
  padding: 20px;
  text-transform:uppercase;
}
              
            
!

JS

              
                
              
            
!
999px

Console