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

              
                <div id="page">

  <a href="#" class="open-panel"><i class="icon-reorder icon-2x"></i></a>

<nav>
  <a href="#" class="close-panel"><i class="icon-remove-sign icon-large"></i></a>
  <ul class="menu">
    <li><a href="#">Menu Item</a></li>
    <li><a href="#">Menu Item</a></li>
    <li><a href="#">Menu Item</a></li>
    <li><a href="#">Menu Item</a></li>
    <li><a href="#">Menu Item</a></li>
  </ul>
</nav>

<div id="content">
  <h2>Page content</h2>
  <p>Make the browser smaller, then click the hamburger icon to see it in action. For some reason the media queries aren't working on the Codepen Details page, so view it in editor mode.</p>
  <p>Ducimus provident recusandae magnam omnis minima cumque nemo consequuntur ea aliquid amet distinctio sint iure molestiae necessitatibus quia nulla quasi dolorum tempora voluptas quaerat qui labore aspernatur atque fugiat quis vero fugit.</p>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptas tempore porro optio unde dignissimos nam? Reiciendis minus molestias quia delectus.</p>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ducimus provident recusandae magnam omnis minima cumque nemo consequuntur ea aliquid amet distinctio sint iure molestiae necessitatibus quia nulla quasi dolorum tempora voluptas quaerat qui labore aspernatur atque fugiat quis vero fugit.</p>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptas tempore porro optio unde dignissimos nam? Reiciendis minus molestias quia delectus.</p>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Necessitatibus magni quasi possimus soluta quam dolores maiores hic voluptas deleniti amet harum iste voluptatibus minus cum praesentium eius odio atque assumenda reiciendis vel qui dolorem sapiente aperiam corporis explicabo adipisci voluptatum optio mollitia ipsum rerum. Numquam repudiandae maxime eveniet sed. Modi.</p>
</div>
  
</div><!-- #page -->
              
            
!

CSS

              
                @import "compass/css3";

/* Setting things up */

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

#page {
  padding: 1em;
  background: #fafafa;
}

#content {
  clear: both;
  padding-top: 1em;
}

nav a {
  color: #fff;
}

/* Important stuff */

ul.menu {
  padding: 0;
  width: 100%;
  
  li {
    list-style-type: none;
    display: block;
    float: left;
    background: #777;
    margin: 0;
    padding: .5em 0;
    -webkit-box-sizing: border-box;
	  -moz-box-sizing: border-box; /* Fixes Firefox bug */
	  box-sizing: border-box;
    width: 20%;
    text-align: center;
    
    &:hover {
      background: #888;
    }
  }
}

a.open-panel, a.close-panel {
  display: none;
}

@media only screen and (max-width: 55em) {
  
  #content {
    padding-top: 0;
  }
  
 /* Move nav off screen, setup transitions */
 nav {
    width: 70%;
    position: absolute;
    left: -70%;
    top: 0;
    height: 100%;
    background: #777;
  }
  
  /* Display nav items vertically */
  ul.menu {
    border-top: 1px solid #888;
    
    li {
      float: none;
      width: 100%;
      text-align: left;
      padding: .5em 1em;
      box-sizing: border-box;
      border-bottom: 1px solid #888;
    }
  }
  
  /* Reveal open/close buttons */
  a.open-panel, a.close-panel {
    display: inline;
  }
  
  .close-panel {
    position: relative;
    top: .5em;
    left: 1em;
  }

  .openNav #page {
    left: 0;
    -webkit-transform: translate3d(70%, 0, 0);
    -moz-transform: translate3d(70%, 0, 0);
    -ms-transform: translate3d(70%, 0, 0);
    -o-transform: translate3d(70%, 0, 0);
    transform: translate3d(70%, 0, 0);
    -webkit-transition: -webkit-transform 500ms ease;
    -moz-transition: -moz-transform 500ms ease;
    -o-transition: -o-transform 500ms ease;
    transition: transform 500ms ease;
  }
  
  /* When the panel is closed, transition the page back to the left */
  #page {
    left: 0;
    -webkit-transform: translate3d(0, 0, 0);
    -moz-transform: translate3d(0, 0, 0);
    -ms-transform: translate3d(0, 0, 0);
    -o-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-transition: -webkit-transform 500ms ease;
    -moz-transition: -moz-transform 500ms ease;
    -o-transition: -o-transform 500ms ease;
    transition: transform 500ms ease;
  }
}
              
            
!

JS

              
                $(".open-panel").click(function(){
  
  $("html").addClass("openNav");
  
});
	
$(".close-panel, #content").click(function(){
  
$("html").removeClass("openNav");
  
});
              
            
!
999px

Console