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>
  <ul>
    <li class="menu-item menu-item--shop">
      <svg viewBox="0 0 32 32">
        <use xlink:href="#icon-cart"></use>
      </svg>
      <a href="#">Shop</a>
    </li>
    <li class="menu-item menu-item--videos">
      <svg viewBox="0 0 32 32">
        <use xlink:href="#icon-play"></use>
      </svg>
      <a href="#">Videos</a>
    </li>
    <li class="menu-item menu-item--gallery">
      <svg viewBox="0 0 32 32">
        <use xlink:href="#icon-image"></use>
      </svg>
      <a href="#">Gallery</a>
    </li>
    <li class="menu-item menu-item--contact">
      <svg viewBox="0 0 32 32">
        <use xlink:href="#icon-phone"></use>
      </svg>
      <a href="#">Contact</a>
    </li>
  </ul>
</nav>

<!-- icons source https://codepen.io/chriscoyier/pen/lcDBd -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display: none;">
<defs>
<g id="icon-image">
    <path class="path1" d="M0 4v26h32v-26h-32zM30 28h-28v-22h28v22zM22 11c0-1.657 1.343-3 3-3s3 1.343 3 3c0 1.657-1.343 3-3 3-1.657 0-3-1.343-3-3zM28 26h-24l6-16 8 10 4-3z"></path>
</g>
<g id="icon-play">
    <path class="path1" d="M30.662 5.003c-4.488-0.645-9.448-1.003-14.662-1.003-5.214 0-10.174 0.358-14.662 1.003-0.86 3.366-1.338 7.086-1.338 10.997 0 3.911 0.477 7.63 1.338 10.997 4.489 0.645 9.448 1.003 14.662 1.003 5.214 0 10.174-0.358 14.662-1.003 0.86-3.366 1.338-7.086 1.338-10.997 0-3.911-0.477-7.63-1.338-10.997zM12 22v-12l10 6-10 6z"></path>
</g>
<g id="icon-cart">
    <path class="path1" d="M30.549 6.077c-1.062-0.303-2.169 0.312-2.473 1.374l-0.157 0.549h-18.654l-0.281-2.248c-0.125-1.001-0.976-1.752-1.985-1.752h-5c-1.105 0-2 0.895-2 2s0.895 2 2 2h3.234l1.781 14.248c0.125 1.001 0.976 1.752 1.985 1.752h17c0.893 0 1.678-0.592 1.923-1.451l4-14c0.303-1.062-0.312-2.169-1.374-2.473zM16 16v-2h4v2h-4zM20 18v2h-4v-2h4zM16 12v-2h4v2h-4zM9.516 10h4.484v2h-4.234l-0.25-2zM10.016 14h3.984v2h-3.734l-0.25-2zM10.516 18h3.484v2h-3.234l-0.25-2zM24.491 20h-2.491v-2h3.063l-0.571 2zM25.634 16h-3.634v-2h4.206l-0.571 2zM26.777 12h-4.777v-2h5.349l-0.571 2zM8 29c0-1.657 1.343-3 3-3s3 1.343 3 3c0 1.657-1.343 3-3 3-1.657 0-3-1.343-3-3zM20 29c0-1.657 1.343-3 3-3s3 1.343 3 3c0 1.657-1.343 3-3 3-1.657 0-3-1.343-3-3z"></path>
</g>
<g id="icon-phone">
    <path class="path1" d="M22 20c-2 2-2 4-4 4s-4-2-6-4-4-4-4-6 2-2 4-4-4-8-6-8-6 6-6 6c0 4 4.109 12.109 8 16s12 8 16 8c0 0 6-4 6-6s-6-8-8-6z"></path>
</g>
</defs>
</svg>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700);

body {
  font-family: 'Source Sans Pro', sans-serif;
}

nav {
  width: 300px;
  margin: 5rem auto 0 auto;
  background-color: #b5b5b5;
}

nav ul {
  list-style-type: none;
}

.menu-item {
  color: white;
  border-bottom: 1px solid white;
  padding: .8rem 1rem;
  position: relative;
  
  &--shop {
    color: #24C7B7;
  }
  
  &--videos {
    color: #D45542;
  }
  
  &--gallery {
    color: #DEB63E;
  }
  
  &--contact {
    color: #161652;
  }
  
  &::before {
    content: '';
    border-left: 5px solid #b5b5b5;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    transition: border-color .3s ease-in-out;
  }
  
  a {
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 1px;
    line-height: 3.2rem;
  }
  
  svg {
    display: inline-block;
    vertical-align: middle;
    width: 3.2rem;
    height: 3.2rem;
    margin-right: 1.5rem;
    fill: white;
    transition: fill .3s ease-in-out;
  }
  
  &:hover {
    &::before {
      border-color: currentColor;
    }
    
    svg {
      fill: currentColor;
    }
  }
}


              
            
!

JS

              
                
              
            
!
999px

Console