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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <nav role="navigation">
  <div id="menuToggle"> 
    <!--
    hidden checkbox is used as click reciever,
    so you can use the :checked selector on it.
    -->
    <input name="toggle" type="checkbox" />
    <label for="toggle">
      <span>menu</span>
      <!--
      divs to be styled as a hamburger button
      -->
      <div></div>
      <div></div>
      <div></div>
    </label>

    
    <!--
    the menu that will slide in from the left
    -->
    <ul id="menu">
      <a href="#"><li>Home</li></a>
      <a href="#"><li>About</li></a>
      <a href="#"><li>Contact</li></a>
    </ul>
  </div>
</nav>
              
            
!

CSS

              
                /* Base styles */
body {
  margin: 0;
  padding: 0;
  background: #232323;
  color: #cdcdcd;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji
}

#menuToggle {
  display: block;
  position: relative;
  top: 50px;
  left: 50px;  
  z-index: 1;  
  -webkit-user-select: none;
  -moz-user-select: none;
   -ms-user-select: none;
       user-select: none;
}

#menuToggle a {
  text-decoration: none;
  color: #232323;
  -webkit-transition: color 0.3s ease;
  -o-transition: color 0.3s ease;
  transition: color 0.3s ease;
}

#menuToggle a:hover {
  color: #4f7794;
}


/* The hamburger button hidden inside an input element */
#menuToggle input {
  display: block;
  width: 30px;
  height: 30px;
  position: absolute;
  top: -7px;
  left: -5px;  
  padding: 0;
  cursor: pointer;  
  opacity: 0; /* hide this */
  z-index: 2; /* and place it over the hamburger */  
  -webkit-touch-callout: none;
}

#menuToggle label {
  position: relative;
  display: block;
  width: 30px;
  height: 30px;
}
#menuToggle label span {
  display: none;
}

/*
 * Hamburger
 */
#menuToggle label div {
  display: block;
  width: 30px;
  height: 2px;
  margin-bottom: 6px;
  position: relative;
  background: #cdcdcd;
  border-radius: 3px;  
  z-index: 1;  
  -webkit-transform-origin: 4px 0px;  
      -ms-transform-origin: 4px 0px;  
          transform-origin: 4px 0px;
  -webkit-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
}

#menuToggle label div:first-child {
  -webkit-transform-origin: 0% 100%;
      -ms-transform-origin: 0% 100%;
          transform-origin: 0% 100%;
}

#menuToggle label div:nth-child(2) {
    -webkit-transform-origin: 0% 0%;
      -ms-transform-origin: 0% 0%;
          transform-origin: 0% 0%;
}

/* 
 * Change the color of the hamburger when toggled
 */
#menuToggle input:checked + label div {
  background: #232323;
}

/*
 * Use absolute positioning to place the menu off-screen
 */
#menu {
  position: absolute;
  width: 300px;
  margin: -100px 0 0 -50px;
  padding: 50px;
  padding-top: 125px;
  background: #ededed;
  list-style-type: none;
  /* Hide the menu off-screen to the left */
  left: -100%;
  -webkit-transition: left 0.3s ease;
  -o-transition: left 0.3s ease;
  transition: left 0.3s ease; 
}

#menu li {
  padding: 10px 0;
  font-size: 22px;
}

/*
 * Slide the menu in from left when the input is checked
 */
#menuToggle input:checked ~ ul {
  left: 0;
}
              
            
!

JS

              
                // Nothing
              
            
!
999px

Console