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

              
                <body>
  <header class="header clear">
    <nav class="nav clearfix" role="navigation" id="navigation">
      <a href="#" id="pull" title="Show / Hide Dropdown Menu">Menu<i class="fa fa-bars"></i></a>
      <ul class="menu">
        <li><a href="#" class="active">Home</a></li>
        <li><a href="#" >Shop</a></li>
        <li><a href="#" >About Us</a></li>
        <li><a href="#" >Contact</a></li>
        <li class="icon"><a href="#" title="Shopping Cart">
           <i class="fa fa-shopping-cart"></i>0 items</a>
        </li>
      </ul>
    </nav>
  </header>
  
  <div class="content">
    <p>Compare navigation by using a keyboard and mouse.</p>
  </div>
</body>
              
            
!

CSS

              
                html {
  font-size: 62.5%;
}

body {
  margin: 0;
  padding: 0;
  background: #fefefe;
  color: #444;
  font: 400 17px/1.7 'Open Sans', Helvetica, Arial, sans-serif;
}

a {
  color: #c41e3a;
  text-decoration: none;
}

a:hover {
  color: #007E65;
}

a:focus {
  outline: #007e65 solid 2px;
}

.header {
  max-width: 960px;
  margin: 0 auto;
  padding: 1em 0;
}

.content {
  width: 100%;
  max-width: 600px;
  margin: 3em auto;
  padding: 1em 0;
}

p {
  text-align: center;
}


/* nav */

.nav {
  float: left;
  width: 100%;
  margin: 0;
  padding: 0;
  background: #222;
}

.nav ul {
  display: none;
  height: auto;
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.nav .nav-expand {
  display: block;
}

.nav li {
  float: left;
  width: 100%;
  position: relative;
}

.nav a {
  display: inline-block;
  text-align: left;
  width: 100%;
  text-indent: 25px;
  color: #c41e3a;
  background: #fefefe;
  border-bottom: 1px solid #eee;
  padding: 9px 0;
}

.nav a:hover,
.nav a:focus,
.nav a.active {
  background: #c41e3a;  
  color: #fff;
}

.nav a:hover,
.nav a:active, .nav a:focus {
  outline: 0;
}

.nav li.icon .fa-shopping-cart {
  display: inline;
  margin-right: 0.5em;
}

.nav li.icon a {
  color: #444;
}

.nav li.icon a:hover,
.nav li.icon a:focus,
.nav li.icon a.active {
  color: #fff;
}

.nav #pull {
  display: block;
  background: #222;
  color: #fff;
  width: 100%;
  position: relative;
  padding: 9px 0;
}

.nav #pull .fa-bars {
  font-size: 26px;
  font-size: 2.6rem;
  position: absolute;
  right: 15px;
  top: 10px;
}

.nav #pull:hover,
.nav #pull:focus {
  background: #444;
}

@media only screen and (min-width:768px) {
  /* Navigation - big screens */
  .nav #pull {
    display: none;
  }
  .nav {
    width: 100%;
    background: none;
    font-size: 20px;
    font-size: 2rem;
    text-align: center;
    margin-top: 1em;
  }
  .nav ul {
    display: inline;
  }
  .nav li {
    display: inline-block;
    float: none;
    width: auto;
    margin: 0 0.75em;
    padding: 0;
  }
  .nav a {
    border: none;
    text-indent: 0;
  }
  .nav a:hover {
    color: #007E65;
    background: none;
    border: none;
  }
  .nav a.active {
    color: #007E65;
    background: none;
    border-bottom: 2px solid #007E65;
  }
  .nav a:focus {
    color: #c41e3a;
    background: none;
    outline: #007E65 solid 2px;
  }
  .nav li.icon .fa-shopping-cart {
    width: 1.25em;
  }
  .nav li.icon a,
  .nav li.icon a:focus,
  .nav li.icon a.active {
    color: #444;
  }
  .nav li.icon a:hover {
    color: #007E65;
  }
}
              
            
!

JS

              
                // Dropdown toggle
$('#pull').on('click', function(e) {
		e.preventDefault();
		$('.nav ul').slideToggle(function(){
      $(this).toggleClass('nav-expand').css('display', '');
    });
});

// Active link selection
$('.menu a').on('click', function() {
  $('.menu a.active').removeClass('active');
  $(this).addClass('active');
});
              
            
!
999px

Console