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

              
                <header role="banner">
  <a class="brand" href="/" aria-label="Back to home">
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/174183/logo-3.svg" alt="Acme logo" /> 
  </a>
  <nav>
    <ul class="scroll-track">
      <li>
        <a href="#">About</a>
      </li>
      <li>
        <a href="#">Work</a>
      </li>
      <li>
        <a href="#">Services</a>
      </li>
      <li>
        <a href="#">Blog</a>
      </li>
      <li>
        <a href="#">Team</a>
      </li>
      <li>
        <a href="#">Contact</a>
      </li>
  </nav>
</header>
              
            
!

CSS

              
                /**
 * SCROLL TRACK
 * A wrapper that sits items side-by-side and provides some 
 * bouncy overflow. 
 */
.scroll-track {
  display: flex;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

/* We want items to retain their width within this container, so they break out */
.scroll-track > * {
  flex-shrink: 0;
}






/* Presentational styles */
:root {
  --background: #efefef;
}

body {
  background: var(--background);
  padding: 2rem 1rem;
  line-height: 1.4;
  font-family: sans-serif;
}

header[role="banner"] {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  max-width: 70rem;
  margin: 0 auto;
}

nav {
  display: contents;
}

nav ul {
  margin: 0 0 0 2rem;
  font-weight: 700;
  text-align: right;
  -ms-overflow-style: none;
}

nav ul::-webkit-scrollbar { 
  width: 0; 
  height: 0; 
}

nav a {
  color: #095256;
  display: inline-block;
}

nav li + li {
  margin-left: 1.5rem;
}

nav a:hover,
nav a:focus {
  text-decoration: none;
}

.brand {
  display: inline-block;
  width: 70px;
  flex-shrink: 0;
}

/* Trick stolen from Lea Verou's smart as heck work: http://lea.verou.me/2012/04/background-attachment-local/ */
nav ul {

  background-image: 
	
    /* Shadows */ 
    linear-gradient(to right, var(--background), var(--background)),
    linear-gradient(to right, var(--background), var(--background)),
  
    /* Shadow covers */ 
    linear-gradient(to right, rgba(0, 0, 0, 0.15), rgba(255, 255, 255, 0)),
    linear-gradient(to left, rgba(0, 0, 0, 0.15), rgba(255, 255, 255, 0));   

  background-position: left center, right center, left center, right center;
	background-repeat: no-repeat;
	background-color: var(--background);
	background-size: 20px 100%, 20px 100%, 10px 100%, 10px 100%;
	
	/* Opera doesn't support this in the shorthand */
	background-attachment: local, local, scroll, scroll;
}
              
            
!

JS

              
                
              
            
!
999px

Console