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

              
                <nav id="navbar">
  <header>Documentation</header>
  <a class="nav-link" href="#Description">Description</a>
  <a class="nav-link" href="#Example">Example</a>
  <a class="nav-link" href="#Details">Details</a>
  <a class="nav-link" href="#More">More</a>
  <a class="nav-link" href="#Summary">Summary</a>
</nav>

<main id="main-doc">
  <section class="main-section" id="Description">
  <header>Description</header>
    
  <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Nibh nisl condimentum id venenatis a condimentum. Pellentesque habitant morbi tristique senectus et netus et malesuada. Eu lobortis elementum nibh tellus. Viverra adipiscing at in tellus integer feugiat. Diam vel quam elementum pulvinar etiam non quam lacus suspendisse.
  </p>
  <code>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
  </code>
  </section>
  
  <section class="main-section" id="Example">
  <header>Example</header>
    
    <code>Accumsan sit amet nulla facilisi morbi tempus iaculis urna id. Et netus et malesuada fames. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere morbi.
  </code>
  <p>
    Tincidunt arcu non sodales neque sodales ut etiam sit amet. Ultricies integer quis auctor elit. Vel pharetra vel turpis nunc eget lorem dolor sed viverra.
    </p>
    <p>Sed nisi lacus sed viverra tellus in hac habitasse. Scelerisque in dictum non consectetur a erat. Lacus sed viverra tellus in hac habitasse platea dictumst vestibulum. 
    </p>
  <code>Leo a diam sollicitudin tempor id eu. In est ante in nibh mauris. Scelerisque eu ultrices vitae auctor eu augue ut. Enim sed faucibus turpis in eu mi bibendum neque. Id faucibus nisl tincidunt eget nullam non nisi.
  </code>
  </section>
  
  <section class="main-section" id="Details">
  <header>Details</header>
    
   <code>Accumsan sit amet nulla facilisi morbi tempus iaculis urna id. Et netus et malesuada fames. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere morbi.
  </code>
  <p>
    Dui id ornare arcu odio ut sem nulla pharetra diam. Magna eget est lorem ipsum dolor sit amet consectetur. Faucibus ornare suspendisse sed nisi lacus sed. Lectus proin nibh nisl condimentum id venenatis a condimentum. Orci nulla pellentesque dignissim enim sit.
    </p>
    
    <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus faucibus ornare suspendisse sed. Id velit ut tortor pretium viverra. Sit amet risus nullam eget felis eget. Posuere lorem ipsum dolor sit. 
    </p>
 <code>Accumsan sit amet nulla facilisi morbi tempus iaculis urna id. Et netus et malesuada fames. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere morbi.
  </code>
  </section>
  
  <section class="main-section" id="More">
  <header>More</header>
    
  <p>
    Enim ut tellus elementum sagittis vitae et leo duis ut. Ut consequat semper viverra nam. Purus ut faucibus pulvinar elementum integer enim neque volutpat ac. Mattis rhoncus urna neque viverra justo nec. Pharetra massa massa ultricies mi quis hendrerit dolor. Nibh venenatis cras sed felis. Ornare suspendisse sed nisi lacus sed viverra.
  </p>
    
  <p>
    At imperdiet dui accumsan sit amet nulla facilisi morbi. Adipiscing at in tellus integer feugiat scelerisque varius morbi enim.
  </p>
  </section>
  
  <section class="main-section" id="Summary">
  <header>Summary</header>
  
  <ul>
    <li>
      1
    </li>
    <li>
      2
    </li>
    <li>
      3
    </li>
    <li>
      4
    </li>
    <li>
      5
    </li>
  </ul>
  <p>
    Suspendisse sed nisi lacus sed viverra tellus. Quis auctor elit sed vulputate mi sit amet. Egestas diam in arcu cursus euismod quis viverra. Sed viverra ipsum nunc aliquet. Urna duis convallis convallis tellus id interdum velit laoreet id. 
    </p>
    <p>Viverra vitae congue eu consequat ac felis donec et odio. Quis auctor elit sed vulputate mi sit amet mauris commodo. Pellentesque elit ullamcorper dignissim cras. Euismod lacinia at quis risus sed vulputate. Vitae aliquet nec ullamcorper sit amet risus. Vivamus at augue eget arcu. Euismod nisi porta lorem mollis aliquam ut. 
</p>
<p>
Sed turpis tincidunt id aliquet risus feugiat in. Aliquam eleifend mi in nulla posuere sollicitudin aliquam. Enim nec dui nunc mattis enim ut. In arcu cursus euismod quis viverra nibh cras.
</p>
  </section>
</main>
              
            
!

CSS

              
                #navbar {
  width: 250px;
  height: 100vh;
  position: fixed;
  top: 0px;
  left: 0px;
  display: flex;
  flex-direction: column;
  margin: 20px 0 20px 10px;
}

#navbar header {
  font-size: 1.2rem;
}

#navbar > * {
  margin-bottom: 10px;
}

#main-doc {
  margin-left: 250px;
}

section {
  min-height: 300px;
}

@media only screen and (max-width: 600px) {
  #navbar {
    position: static;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: row;
    margin: 20px 0 20px 10px;
  }
  
  #navbar > * {
  margin-right: 10px;
}

#main-doc {
  margin-left: 0;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console