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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              
<div class="menu-wrap">
  <nav class="menu">
    <div class="icon-list">
      <a href="#"><span>Favorites</span></a>
      <a href="#"><span>Alerts</span></a>
      <a href="#"><span>Messages</span></a>
      <a href="#"><span>Comments</span></a>
      <a href="#"><span>Analytics</span></a>
      <a href="#"><span>Reading List</span></a>
    </div>
    <button class="close-button" id="close-button">X</button>
  </nav>
</div>
<button class="menu-button fa fa-bars" id="open-button">
</button>

<div class="content">
  <h2>Off Canvas Menu</h2>
  <p>Hey there, check it out. Click on that menu button on the right and it'll appear. <br /> To close the menu you can click on the close(X) button or you can click anywhere on the document and it'll be closed.</p>
</div>
            
          
!

CSS

            
              * {
  box-sizing: border-box;
}
body {
  height: 100vh;
  background-color: #CDDC39;
}

.menu-wrap {
  position: fixed;
  right: 0;
  z-index: 1001;
  width: 300px;
  height: 100%;
  padding: 40px;
  background-color: #222;
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
  transition: all 0.5s cubic-bezier(0.7,0,0.3,1);
  transform: translate3d(360px,0,0);
}
.menu-wrap.active {
  transform: translate3d(0px,0,0);
}

.menu-wrap .menu .icon-list a {
  position: relative;
  font-family: "Oswald", "Helvetica Neue", Helvetica, sans-serif;
  display: block;
  padding: 20px;
  text-decoration: none;
  color: #eee;
  font-size: 20px;
  transition: all 0.3s ease;
}
.menu-wrap .menu .icon-list a::before {
  position: absolute;
  content: "";
  width: 0%;
  height: 2px;
  top: 80%;
  transition: all 0.3s ease;
}
.menu-wrap .menu .icon-list a:hover {
  color: #CDDC39;
}
.menu-wrap .menu .icon-list a:hover::before {
  width: 50%;
  background-color: #CDDC39;
}
/* Buttons */
.menu-button, 
.close-button {
  position: fixed;
  top: 50px;
  width: 50px;
  height: 50px;
  background-color: #fff;
  font-size: 20px;
  border: none;
  outline: none;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(0,0,0,0.2);
}
.menu-button {
  right: 0px;
  z-index: 102;
}
.close-button {
  left: -50px;
  z-index: 100;
}
/* Content */
.content {
  text-align: center;
  color: #282828;
  padding-top: 80px;
}
.content h2 {
  position: relative;
  text-transform: uppercase;
  margin-bottom: 30px;
  font-size: 35px;
  font-family: "Oswald", "Helvetica Neue", Helvetica, sans-serif;
}
.content h2::after {
  position: absolute;
  content: "";
  width: 100px;
  height: 2px;
  background-color: #222;
  bottom: -15px;
  left: 50%;
  margin-left: -50px;
}
.content p {
  width: 80%;
  margin: 10px auto;
  line-height: 1.85;
  color: #444;
  font-family: "Lato", "Helvetica Neue", Helvetica, sans-serif;
}
            
          
!

JS

            
              (function($) {
  "use strict";
  var openBtn = $("#open-button"),
    colseBtn = $("#close-button"),
    menu = $(".menu-wrap");
  // Open menu when click on menu button
  openBtn.on("click", function() {
    menu.addClass("active");
  });
  // Close menu when click on Close button
  colseBtn.on("click", function() {
    menu.removeClass("active");
  });
  // Close menu when click on anywhere on the document
  $(document).on("click", function(e) {
    var target = $(e.target);
    if (target.is(".menu-wrap, .menu, .icon-list, .icon-list a, .icon-list a span, #open-button") === false) {
      menu.removeClass("active");
      e.stopPropagation();
    }
  });
})(jQuery);
            
          
!
999px

Console