Pen Settings

HTML

CSS

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

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

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.

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="menu-toggle">
  <div id="menu-icon">
    <span></span>
    <span></span>
    <span></span>
    <span></span>
    <span></span>
    <span></span>
  </div>
  Menu
</div>
<div id="menu-overlay"></div>
<ul id="menu">
  <li><a href="http://www.designcouch.com" target="_blank">Visit My Site</a></li>
  <li><a href="#">No children...</a></li>
  <li><a href="#">Hey - this one has some kids! Click the arrow.</a>
    <ul>
      <li><a href="#">I'm a kid!</a></li>
      <li><a href="#">I'm a kid!</a></li>
      <li><a href="#">Got kids of my own...</a>
        <ul>
          <li><a href="#">I'm a grandkid!</a></li>
          <li><a href="#">I'm a grandkid!</a></li>
          <li><a href="#">I'm a grandkid!</a></li>
        </ul>
      </li>
    </ul>
  </li>
  <li><a href="#">I've got kids too.</a>
    <ul>
      <li><a href="#">I'm a kid!</a></li>
      <li><a href="#">I'm a kid!</a></li>
      <li><a href="#">I'm a kid!</a></li>
    </ul>
  </li>
</ul>
<div id="page-content">
  <h1>Here's some hip page content.</h1>
<p>Put a bird on it Blue Bottle ennui direct trade  sustainable, literally vinyl kale chips plaid biodiesel occupy Tumblr Pitchfork.  Actually crucifix VHS, single-origin coffee mumblecore American Apparel vegan small batch chia Tumblr cliche.  Church-key Cosby sweater umami, slow-carb leggings lo-fi 90's.  Craft beer keffiyeh hashtag, deep v meggings four loko twee kitsch mumblecore Vice next level forage Echo Park.  Cray swag gentrify skateboard polaroid whatever Williamsburg, leggings art party.  Bespoke biodiesel you probably haven't heard of them, PBR raw denim normcore Tumblr skateboard fanny pack iPhone cred aesthetic.  Next level viral cliche, forage leggings mumblecore flexitarian synth hashtag mustache literally.</p><p>Godard squid stumptown artisan Vice, flannel ennui ugh biodiesel PBR&amp;B 8-bit.  Trust fund messenger bag banh mi Kickstarter, drinking vinegar iPhone butcher crucifix Thundercats.  Deep v drinking vinegar mlkshk, selvage Brooklyn Pitchfork banjo +1 Carles slow-carb synth mixtape Tonx.  Pop-up you probably haven't heard of them fingerstache blog, crucifix hella whatever Cosby sweater bitters.  PBR&amp;B sustainable gluten-free cornhole banh mi messenger bag 90's crucifix chia, next level Carles.  Meggings artisan messenger bag Brooklyn keytar American Apparel.  Helvetica meh Etsy biodiesel normcore Godard.</p><p>Farm-to-table art party mixtape Schlitz.  Squid Vice single-origin coffee, iPhone semiotics tattooed keytar locavore.  Hoodie asymmetrical Schlitz wayfarers, deep v paleo readymade single-origin coffee fixie dreamcatcher PBR&amp;B.  Wes Anderson small batch fixie, retro sriracha Thundercats narwhal put a bird on it.  Whatever chillwave Carles, semiotics Marfa kogi synth typewriter Wes Anderson biodiesel normcore.  Bushwick Pinterest gentrify narwhal.  Carles artisan flexitarian mlkshk.</p><p>Keytar letterpress artisan pug.  Lo-fi kitsch Marfa, cornhole sriracha fashion axe Echo Park shabby chic iPhone.  Cardigan try-hard seitan Cosby sweater biodiesel kitsch.  Plaid pour-over selfies ethical, kale chips iPhone wolf 3 wolf moon Neutra Bushwick.  Sustainable kale chips four loko fixie American Apparel.  Butcher hella swag before they sold out, ethnic messenger bag pork belly disrupt Brooklyn Portland.  Kickstarter artisan Intelligentsia fashion axe, flexitarian Neutra crucifix art party readymade.</p>
</div>
              
            
!

CSS

              
                * {
  -webkit-box-sizing:border-box;
  -moz-box-sizing:border-box;
  -ms-box-sizing:border-box;
  -o-box-sizing:border-box;
  box-sizing:border-box;
  font-family:Helvetica,Arial,sans-serif;
  font-size:15px;
  line-height:15px;
  -webkit-transition: .5s ease-in-out;
  -moz-transition: .5s ease-in-out;
  -o-transition: .5s ease-in-out;
  transition: .5s ease-in-out;
}

body {
  background-color:#f8f8f8;
  padding:45px 0 0 0;
  overflow-x:hidden;
  overflow-y:scroll;
}

/* MENU TOGGLE STYLES */

#menu-toggle {
  position:fixed;
  padding:20px 20px 20px 65px;
  width:100%;
  left:0;
  top:0;
  background:rgba(255,255,255,.9);
  color:#444444;
  z-index:5;
}

#menu-toggle.open {
  left:400px;
}

#menu-icon {
  width: 45px;
  height: 35px;
  position: absolute;
  left:10px;
  top:10px;
  -webkit-transform: rotate(0deg);
  -moz-transform: rotate(0deg);
  -o-transform: rotate(0deg);
  transform: rotate(0deg);
  -webkit-transition: .5s ease-in-out;
  -moz-transition: .5s ease-in-out;
  -o-transition: .5s ease-in-out;
  transition: .5s ease-in-out;
  cursor: pointer;
}

#menu-icon span {
  display: block;
  position: absolute;
  height: 5px;
  width: 50%;
  background: #00aeef;
  opacity: 1;
  -webkit-transform: rotate(0deg);
  -moz-transform: rotate(0deg);
  -o-transform: rotate(0deg);
  transform: rotate(0deg);
  -webkit-transition: .25s ease-in-out;
  -moz-transition: .25s ease-in-out;
  -o-transition: .25s ease-in-out;
  transition: .25s ease-in-out;
}

#menu-icon span:nth-child(even) {
  left: 50%;
}

#menu-icon span:nth-child(odd) {
  left:0px;
}

#menu-icon span:nth-child(1), #menu-icon span:nth-child(2) {
  top: 5px;
}

#menu-icon span:nth-child(3), #menu-icon span:nth-child(4) {
  top: 15px;
}

#menu-icon span:nth-child(5), #menu-icon span:nth-child(6) {
  top: 25px;
}

#menu-icon.open span:nth-child(1),#menu-icon.open span:nth-child(6) {
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  transform: rotate(45deg);
}

#menu-icon.open span:nth-child(2),#menu-icon.open span:nth-child(5) {
  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  transform: rotate(-45deg);
}

#menu-icon.open span:nth-child(1) {
  left: 5px;
  top: 8px;
}

#menu-icon.open span:nth-child(2) {
  left: calc(50% - 5px);
  top: 8px;
}

#menu-icon.open span:nth-child(3) {
  left: -50%;
  opacity: 0;
}

#menu-icon.open span:nth-child(4) {
  left: 100%;
  opacity: 0;
}

#menu-icon.open span:nth-child(5) {
  left: 5px;
  top: 21px;
}

#menu-icon.open span:nth-child(6) {
  left: calc(50% - 5px);
  top: 21px;
}

/* MENU STYLES */
ul#menu, #menu ul {
  list-style-type:none;
  padding:0;
  margin:0;
}

#menu {
  background:#222222;
  width:400px;
  position:fixed;
  top:0;
  bottom:0;
  left:-400px;
  z-index:4;
}

#menu li{
  position:relative;
  opacity:1;
  left:0;
}

#menu li.disabled {
  opacity:0;
  left:-400px;
}

#menu li a {
  position:relative;
  left:0;
}

#menu.open {
  left:0;
}

#menu a {
  display:block;
  padding:15px;
  text-decoration:none;
  color:#929292;
}

#menu a:hover {
  color:white;
}

#menu > .parent > ul {
  position:fixed;
  top:0;
  bottom:0;
  left:-400px;
  width:355px;
  background:#333333;
}

#menu > .parent > ul > .parent > ul {
  position:fixed;
  top:0;
  bottom:0;
  left:-400px;
  width:310px;
  background:#444444;
}

#menu > .parent.open > ul {
  left:0;
}

#menu > .parent.open > ul > .parent.open > ul {
  left:0;
}

.submenu-toggle {
  position:absolute;
  z-index:1;
  right:0px;
  top:0px;
  cursor:pointer;
  width:45px;
  height:45px;
  text-indent:-5000px;
  overflow:hidden;
}

.submenu-toggle.open {
  background:rgba(255,255,255,.1);
  height:100%;
  z-index:5000;
  top:0;
}

.submenu-toggle:before,.submenu-toggle:after {
  -webkit-transition:.5s ease-in-out;
}

.submenu-toggle:before {
  content:'';
  display:block;
  position:absolute;
  height:16px;
  width:16px;
  top:12px;
  right:15px;
  border-top:5px solid #929292;
  border-right:5px solid #929292;
  -webkit-transform:rotate(45deg);
}

.submenu-toggle:after {
  content:'';
  display:block;
  position:absolute;
  height:16px;
  width:16px;
  top:12px;
  left:50px;
  border-top:5px solid #929292;
  border-right:5px solid #929292;
  -webkit-transform:rotate(-135deg);
}

.submenu-toggle:hover:before, .submenu-toggle:hover:after {
  border-color:white;
}

.submenu-toggle.open:before {
  right:23px;
}

.submenu-toggle.open:after {
  left:23px;
}

#menu-overlay {
  position:fixed;
  width:100%;
  background:red;
  top:55px;
  bottom:0;
  left:0;
  z-index:0;
  background:rgba(255,255,255,.0);
}

#menu-overlay.open {
  z-index:3;
  background:rgba(255,255,255,.9);
}

/* CONTENT AREA STYLES */

#page-content {
  padding:20px;
  max-width:960px;
  margin:0 auto;
  position:relative;
  left:0;
  z-index:1;
}

#page-content.open {
  left:400px;
}

#page-content h1 {
  font-size:30px;
  font-weight:100;
  padding-bottom:20px;
}

#page-content p {
  font-size:14px;
  line-height:22px;
}
              
            
!

JS

              
                $(document).ready(function(){
  
  // NAVIGATION MENU
  
  // menu icon states, opening main nav
  $('#menu-icon').click(function(){
    $(this).toggleClass('open');
    $('#menu,#menu-toggle,#page-content,#menu-overlay').toggleClass('open');
    $('#menu li,.submenu-toggle').removeClass('open');
    $('#menu li').removeClass('disabled');
  });
  
  // clicking on overlay closes menu
  $('#menu-overlay').click(function(){
    $('*').removeClass('open');
    $('*').removeClass('disabled');
  });
  
  // add child menu toggles and parent class
  $('#menu li').has('ul').addClass('parent').prepend('<div class="submenu-toggle">open</div>');
  
  // toggle child menus
  $('.submenu-toggle').click(function(){
    var currentToggle=$(this);
    currentToggle.parent().siblings().toggleClass('disabled');
    currentToggle.parent().toggleClass('open');
    currentToggle.toggleClass('open');
  });
});
              
            
!
999px

Console