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

              
                <nav class="menu slide-menu-left">
    <ul>
      <li><button class="close-menu">← Close</button></li>
      <li><a href="#">Broccoli</a></li>
      ...
    </ul>
  </nav><!-- /slide menu left -->
 
  <nav class="menu slide-menu-right">
    <ul>
      <li><button class="close-menu">Close →</button></li>
      <li><a href="#">Broccoli</a></li>
      ...
    </ul>
  </nav><!-- /slide menu right -->
 
  <nav class="menu slide-menu-top">
    <ul>
      <li><button class="close-menu">↑ Close</button></li>
      <li><a href="#">Broccoli</a></li>
      ...
    </ul>
  </nav><!-- /slide menu top -->
 
  <nav class="menu slide-menu-bottom">
    <ul>
      <li><button class="close-menu">Close ↓</button></li>
      <li><a href="#">Broccoli</a></li>
      ...
    </ul>
  </nav><!-- /slide menu bottom -->
 
  <nav class="menu push-menu-left">
    <ul>
      <li><button class="close-menu">← Close</button></li>
      <li><a href="#">Broccoli</a></li>
      ...
    </ul>
  </nav><!-- /push menu left -->
 
  <nav class="menu push-menu-right">
    <ul>
      <li><button class="close-menu">Close →</button></li>
      <li><a href="#">Broccoli</a></li>
      ...
    </ul>
  </nav><!-- /push menu right -->
 
  <nav class="menu push-menu-top">
    <ul>
      <li><button class="close-menu">↑ Close</button></li>
      <li><a href="#">Broccoli</a></li>
      ...
    </ul>
  </nav><!-- /push menu top -->
 
  <nav class="menu push-menu-bottom">
    <ul>
      <li><button class="close-menu">Close ↓</button></li>
      <li><a href="#">Broccoli</a></li>
      ...
    </ul>
  </nav><!-- /push menu bottom -->
 
  <div id="wrapper">
    <div id="main">
      <div class="container">
        <div class="buttons">
          <button class="nav-toggler toggle-slide-left">Slide Menu Left</button>
          <button class="nav-toggler toggle-slide-right">Slide Menu Right</button>
          <button class="nav-toggler toggle-slide-top">Slide Menu Top</button>
          <button class="nav-toggler toggle-slide-bottom">Slide Menu Bottom</button>
          <button class="nav-toggler toggle-push-left">Push Menu Left</button>
          <button class="nav-toggler toggle-push-right">Push Menu Right</button>
          <button class="nav-toggler toggle-push-top">Push Menu Top</button>
          <button class="nav-toggler toggle-push-bottom">Push Menu Bottom</button>
        </div><!-- /buttons -->
        <section class="content">
          <h1>Vegetables</h1>
          <p>Turnip greens yarrow...</p>
        </section><!-- /.content -->
      </div>
    </div><!-- #main -->
 
  </div><!-- /#wrapper -->
              
            
!

CSS

              
                body {
  overflow-x: hidden;
}
#wrapper {
  position: relative;
  z-index: 10;
  top: 0;
  left: 0;
  -webkit-transition: all 0.3s;
  -moz-transition: all 0.3s;
  -ms-transition: all 0.3s;
  -o-transition: all 0.3s;
  transition: all 0.3s;
}
section {
  margin-bottom: 30px;
}
section h1 {
  font-family: "Oswald", sans-serif;
  margin-bottom: 10px;
}
section p {
  margin-bottom: 30px;
}
section p:last-child {
  margin-bottom: 0;
}
section:last-child {
  margin-bottom: 0;
}
section.toggle {
  text-align: center;
}
.mask {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 15;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
}
/* Menus */
/* general style for all menus */
nav.menu {
  position: fixed;
  z-index: 20;
  background-color: #67b5d1;
  overflow: hidden;
  -webkit-transition: all 0.3s;
  -moz-transition: all 0.3s;
  -ms-transition: all 0.3s;
  -o-transition: all 0.3s;
  transition: all 0.3s;
}
nav.menu ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}
nav.menu a {
  font-weight: 300;
  color: #fff;
}
button.close-menu {
  background-color: #3184a1;
  color: #fff;
}
button.close-menu:focus {
  outline: none;
}

nav.slide-menu-left {
  top: 0;
  width: 300px;
  height: 100%;
}
nav.slide-menu-left li {
  display: block;
  text-align: center;
  border-bottom: solid 1px #3184a1;
  border-top: solid 1px #b5dbe9;
}
nav.slide-menu-left li:first-child {
  border-top: none;
}
nav.slide-menu-left li:last-child {
  border-bottom: none;
}
nav.slide-menu-left a {
  display: block;
  padding: 10px;
  font-size: 18px;
}
nav.slide-menu-left button.close-menu {
  margin: 10px 0;
  padding: 10px 30px;
  background-color: #3184a1;
  color: #fff;
}
nav.slide-menu-left {
  left: -300px;
}
body.sml-open nav.slide-menu-left {
  left: 0;
}

nav.slide-menu-right {
  top: 0;
  width: 300px;
  height: 100%;
}
nav.slide-menu-right li {
  display: block;
  text-align: center;
  border-bottom: solid 1px #3184a1;
  border-top: solid 1px #b5dbe9;
}
nav.slide-menu-right li:first-child {
  border-top: none;
}
nav.slide-menu-right li:last-child {
  border-bottom: none;
}
nav.slide-menu-right a {
  display: block;
  padding: 10px;
  font-size: 18px;
}
nav.slide-menu-right button.close-menu {
  margin: 10px 0;
  padding: 10px 30px;
  background-color: #3184a1;
  color: #fff;
}
nav.slide-menu-right {
  right: -300px;
}
body.smr-open nav.slide-menu-right {
  right: 0;
}

/**/
nav.slide-menu-top {
  left: 0;
  width: 100%;
  height: 100px;
}
nav.slide-menu-top ul {
  text-align: center;
  padding: 25px 0 0 0;
}
nav.slide-menu-top li {
  display: inline-block;
  margin: 0;
  vertical-align: middle;
}
nav.slide-menu-top a {
  display: block;
  line-height: 50px;
  padding: 0 10px;
  font-size: 18px;
}
nav.slide-menu-top button.close-menu {
  display: block;
  line-height: 50px;
  margin: 0;
  padding: 0 10px;
}
nav.slide-menu-top {
  top: -100px;
}
body.smt-open nav.slide-menu-top {
  top: 0;
}

/**/
nav.slide-menu-bottom {
  left: 0;
  width: 100%;
  height: 100px;
}
nav.slide-menu-bottom ul {
  text-align: center;
  padding: 25px 0 0 0;
}
nav.slide-menu-bottom li {
  display: inline-block;
  margin: 0;
  vertical-align: middle;
}
nav.slide-menu-bottom a {
  display: block;
  line-height: 50px;
  padding: 0 10px;
  font-size: 18px;
}
nav.slide-menu-bottom button.close-menu {
  display: block;
  line-height: 50px;
  margin: 0;
  padding: 0 10px;
}
nav.slide-menu-bottom {
  bottom: -100px;
}
body.smb-open nav.slide-menu-bottom {
  bottom: 0;
}

/**/
nav.push-menu-left {
  top: 0;
  width: 300px;
  height: 100%;
}
nav.push-menu-left li {
  display: block;
  text-align: center;
  border-bottom: solid 1px #3184a1;
  border-top: solid 1px #b5dbe9;
}
nav.push-menu-left li:first-child {
  border-top: none;
}
nav.push-menu-left li:last-child {
  border-bottom: none;
}
nav.push-menu-left a {
  display: block;
  padding: 10px;
  font-size: 18px;
}
nav.push-menu-left button.close-menu {
  margin: 10px 0;
  padding: 10px 30px;
  background-color: #3184a1;
  color: #fff;
}
nav.push-menu-left {
  left: -300px;
}
body.pml-open nav.push-menu-left {
  left: 0;
}
body.pml-open #wrapper {
  left: 300px;
}

/**/
nav.push-menu-right {
  top: 0;
  width: 300px;
  height: 100%;
}
nav.push-menu-right li {
  display: block;
  text-align: center;
  border-bottom: solid 1px #3184a1;
  border-top: solid 1px #b5dbe9;
}
nav.push-menu-right li:first-child {
  border-top: none;
}
nav.push-menu-right li:last-child {
  border-bottom: none;
}
nav.push-menu-right a {
  display: block;
  padding: 10px;
  font-size: 18px;
}
nav.push-menu-right button.close-menu {
  margin: 10px 0;
  padding: 10px 30px;
  background-color: #3184a1;
  color: #fff;
}
nav.push-menu-right {
  right: -300px;
}
body.pmr-open nav.push-menu-right {
  right: 0;
}
body.pmr-open #wrapper {
  left: -300px;
}

/**/
nav.push-menu-top {
  left: 0;
  width: 100%;
  height: 100px;
}
nav.push-menu-top ul {
  text-align: center;
  padding: 25px 0 0 0;
}
nav.push-menu-top li {
  display: inline-block;
  margin: 0;
  vertical-align: middle;
}
nav.push-menu-top a {
  display: block;
  line-height: 50px;
  padding: 0 10px;
  font-size: 18px;
}
nav.push-menu-top button.close-menu {
  display: block;
  line-height: 50px;
  margin: 0;
  padding: 0 10px;
}
nav.push-menu-top {
  top: -100px;
}
body.pmt-open nav.push-menu-top {
  top: 0;
}
body.pmt-open #wrapper {
  top: 100px;
}

/**/
nav.push-menu-bottom {
  left: 0;
  width: 100%;
  height: 100px;
}
nav.push-menu-bottom ul {
  text-align: center;
  padding: 25px 0 0 0;
}
nav.push-menu-bottom li {
  display: inline-block;
  margin: 0;
  vertical-align: middle;
}
nav.push-menu-bottom a {
  display: block;
  line-height: 50px;
  padding: 0 10px;
  font-size: 18px;
}
nav.push-menu-bottom button.close-menu {
  display: block;
  line-height: 50px;
  margin: 0;
  padding: 0 10px;
}
nav.push-menu-bottom {
  bottom: -100px;
}
body.pmb-open nav.push-menu-bottom {
  bottom: 0;
}
body.pmb-open #wrapper {
  top: -100px;
}

              
            
!

JS

              
                // classie js
!function(s){"use strict";function n(s){return new RegExp("(^|\\s+)"+s+"(\\s+|$)")}var a,e,c;"classList"in document.documentElement?(a=function(s,n){return s.classList.contains(n)},e=function(s,n){s.classList.add(n)},c=function(s,n){s.classList.remove(n)}):(a=function(s,a){return n(a).test(s.className)},e=function(s,n){a(s,n)||(s.className=s.className+" "+n)},c=function(s,a){s.className=s.className.replace(n(a)," ")}),s.classie={hasClass:a,addClass:e,removeClass:c,has:a,add:e,remove:c}}(window);
// end of classie js

(function( window ){
 
  'use strict';
 
  var body = document.body,
    mask = document.createElement("div"),
    toggleSlideLeft = document.querySelector( ".toggle-slide-left" ),
    toggleSlideRight = document.querySelector( ".toggle-slide-right" ),
    toggleSlideTop = document.querySelector( ".toggle-slide-top" ),
    toggleSlideBottom = document.querySelector( ".toggle-slide-bottom" ),
    togglePushLeft = document.querySelector( ".toggle-push-left" ),
    togglePushRight = document.querySelector( ".toggle-push-right" ),
    togglePushTop = document.querySelector( ".toggle-push-top" ),
    togglePushBottom = document.querySelector( ".toggle-push-bottom" ),
    slideMenuLeft = document.querySelector( ".slide-menu-left" ),
    slideMenuRight = document.querySelector( ".slide-menu-right" ),
    slideMenuTop = document.querySelector( ".slide-menu-top" ),
    slideMenuBottom = document.querySelector( ".slide-menu-bottom" ),
    pushMenuLeft = document.querySelector( ".push-menu-left" ),
    pushMenuRight = document.querySelector( ".push-menu-right" ),
    pushMenuTop = document.querySelector( ".push-menu-top" ),
    pushMenuBottom = document.querySelector( ".push-menu-bottom" ),
    activeNav
  ;
  mask.className = "mask";
 
  /* slide menu left */
  toggleSlideLeft.addEventListener( "click", function(){
    classie.add( body, "sml-open" );
    document.body.appendChild(mask);
    activeNav = "sml-open";
  } );
 
  /* slide menu right */
  toggleSlideRight.addEventListener( "click", function(){
    classie.add( body, "smr-open" );
    document.body.appendChild(mask);
    activeNav = "smr-open";
  } );
 
  /* slide menu top */
  toggleSlideTop.addEventListener( "click", function(){
    classie.add( body, "smt-open" );
    document.body.appendChild(mask);
    activeNav = "smt-open";
  } );
 
  /* slide menu bottom */
  toggleSlideBottom.addEventListener( "click", function(){
    classie.add( body, "smb-open" );
    document.body.appendChild(mask);
    activeNav = "smb-open";
  } );
 
  /* push menu left */
  togglePushLeft.addEventListener( "click", function(){
    classie.add( body, "pml-open" );
    document.body.appendChild(mask);
    activeNav = "pml-open";
  } );
 
  /* push menu right */
  togglePushRight.addEventListener( "click", function(){
    classie.add( body, "pmr-open" );
    document.body.appendChild(mask);
    activeNav = "pmr-open";
  } );
 
  /* push menu top */
  togglePushTop.addEventListener( "click", function(){
    classie.add( body, "pmt-open" );
    document.body.appendChild(mask);
    activeNav = "pmt-open";
  } );
 
  /* push menu bottom */
  togglePushBottom.addEventListener( "click", function(){
    classie.add( body, "pmb-open" );
    document.body.appendChild(mask);
    activeNav = "pmb-open";
  } );
 
  /* hide active menu if mask is clicked */
  mask.addEventListener( "click", function(){
    classie.remove( body, activeNav );
    activeNav = "";
    document.body.removeChild(mask);
  } );
 
  /* hide active menu if close menu button is clicked */
  [].slice.call(document.querySelectorAll(".close-menu")).forEach(function(el,i){
    el.addEventListener( "click", function(){
      classie.remove( body, activeNav );
      activeNav = "";
      document.body.removeChild(mask);
    } );
  });
 
})( window );
              
            
!
999px

Console