css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <nav>
  
  <a href="#" class="profile icon-user"></a>
  <a href="#" class="logo">logo</a>
  <a href="#" class="search icon-search"></a>
  
  <div class="main-nav">
    <ul>
      <li><a href="#">longform</a></li>
      <li><a href="#">reviews</a></li>
      <li><a href="#">videos</a></li>
      <li><a href="#">tech</a></li>
      <li><a href="#">science</a></li>
      <li><a href="#">entertainment</a></li>
      <li><a href="#">cars</a></li>
      <li><a href="#">design</a></li>
    </ul>
  </div>
  <div class="fade"></div>
  
</nav>
            
          
!
            
              //Import icons
@import url('//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css');
//Media query to switch modes
@mixin large {
  @media (min-width: 800px) {
    @content;
  }
}

//Responsive typography (optional)
html {
  font-size: 16px;
  @include large {
    font-size: 18px;
  }
}

body {
  font-family: -apple-system, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  width: 100%;
  color: white;
}

a {
  transition: opacity 150ms ease;
  text-decoration: none;
  color: inherit;
  &:hover {
    opacity: .75;
  }
}

nav {
  position: relative;
  display: flex;
  width: 100%;
  background: grey;
  flex-flow: row wrap;
  justify-content: space-between;
  @include large {
    flex-flow: row nowrap;
  }
}

.logo {
  margin: .5rem;
  text-transform: uppercase;
  color: lightGray;
  flex: 0 1 auto;
  order: 2;
  //Move to 1st position and add space on larger devices
  @include large {
    margin-right: 1rem;
    order: 1;
  }
}

.profile {
  font-size: 1.4rem;
  line-height: 1.5rem;
  padding: .5rem;
  //Non-essential, just OCD
  transform: translateY(.05rem);
  flex: 0 1 auto;
  order: 1;
  //Move to 3rd position on larger devices
  @include large {
    order: 3;
  }
}

.search {
  font-size: 1.2rem;
  line-height: 1.5rem;
  padding: .5rem;
  flex: 0 1 auto;
  order: 3;
  //Move to 4th position on larger devices
  @include large {
    order: 4;
  }
}

.main-nav {
  overflow-x: scroll;
  padding-right: 1rem;
  white-space: nowrap;
  flex: 1 1 100%;
  order: 4;
  -webkit-overflow-scrolling: touch;
  //Move main navigation to 2nd position or larger devices
  @include large {
    order: 2;
  }
  //Allow horizontal scrolling on smaller screens
  li {
    display: inline-block;
    padding: .5rem;
    text-transform: capitalize;
  }
  li:last-child {
    margin-right: 2rem;
  }
}

//Add visual cue indicating that there is more content
.fade {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 5rem;
  height: 2rem;
  background: linear-gradient( 90deg, rgba(grey, 0), grey);
  @include large {
    display: none;
  }
  pointer-events: none;
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console