octocatstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Want a Run Button?

If active, the preview will update automatically when you change code.

            
              <nav role="navigation">
  <ul>
    <li><a href="#">home</a></li>
    <li><a href="#">about</a></li>
    <li><a href="#">blog</a></li>
    <li><a href="#">FAQs</a></li>
    <li><a href="#">a link with a lot of text</a></li>
    <!-- add or remove items -->
  </ul>
</nav>

<nav role="navigation">
  <ul>
    <li><a href="#">home</a></li>
    <li><a href="#">about</a></li>
    <li><a href="#">blog</a></li>
    <li><a href="#">FAQs</a></li>
     <li><a href="#">a link with a lot of text</a></li>
    <li><a href="#">shop</a></li>
    <li><a href="#">endorsements</a></li>
    <!-- add or remove items -->
  </ul>
</nav>
            
          
!
            
              /* table layout if there are less than 6 items */

nav ul {
  display: table;
  table-layout: fixed;
  width: 100%;
  text-align: center;
  background: #333;
}

nav li {
  list-style: none;
  display: table-cell;
  vertical-align: middle;
  background: #333;
}

nav li + li {
  border-left: 2px solid #000;
}

nav a {
  text-decoration: none;
  color: #fff;
  display: block;
  padding: 0.75em 1em;
  font-size: 1.25em;
}

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

/* inline-block (wrapping) layout if there are 6 or more items */

nav li:nth-last-child(n+6), 
nav li:nth-last-child(n+6) ~ * {
  display: inline-block;
  border: 0;
}

nav li:nth-last-child(n+6) a, 
nav li:nth-last-child(n+6) ~ * a {
  display: inline-block;
  border: 0;
}

/* boring stuff */

body {
  font-size: 20px;
  font-family: sans-serif;
}

nav {
  margin-top: 3em;
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console