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

              
                <input type="checkbox" id="toggle" name="toggle">

<ul class="navigation-menu">
  <li><a href="#">Home</a></li>
  <li><a href="#">About</a></li>
  <li><a href="#">Contact</a></li>
  <li><a href="#">Blog</a></li>
</ul>

<div class="navbar">
  <label for="toggle"><i class="fa fa-bars"></i> Menu</label>
</div>

<div class="content">
  <h1>Hidden Navigation Menu</h1>
  <p>It's pretty easy to make a hidden navigation menu with pure CSS. Simply use a checkbox as a toggle! Create a label for the checkbox and hide the actual checkbox by giving it "display: none".  Who needs jQuery, right?</p>
  <h2>Lorem ipsum dolor.</h2>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut laudantium deserunt optio sapiente voluptas, quae quidem perferendis voluptatem incidunt, voluptatum beatae blanditiis quam fugit deleniti rem vero tempore? Doloribus, reprehenderit!</p>
  <h2>Lorem ipsum dolor sit.</h2>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eaque, perferendis ipsam amet. Suscipit explicabo pariatur, necessitatibus voluptatum enim velit animi, nesciunt modi facilis impedit, sequi quaerat! Beatae ad, enim porro.</p>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ratione optio a delectus dolor rerum commodi necessitatibus facere eveniet ipsam dolores! Atque architecto nulla magni reprehenderit ad, odio asperiores! Error, molestias.</p>
</div>

              
            
!

CSS

              
                body {
  background: #00B3FF;
  font-family: 'Questrial', sans-serif;
  font-size: 18px;
  line-height: 1.5em;
}

.fa-bars {
  margin-right: 10px;
}

.navigation-menu {
  background: #111;
  height: 100%;
  width: 50%;
  padding: 60px 0;
  margin: 0;
  list-style: none;
  text-align: center;
  position: fixed;
  right: -45%;
  top: 0;
  transition: all 0.5s;
  z-index: 1;
  font-size: 60px;
}

.navigation-menu li {
  padding: 30px 0;
}

.navigation-menu li:nth-of-type(2n) {
  background: #222;
}

.navigation-menu li:hover {
  background: #444;
}

.navigation-menu a {
  color: #E5E5E5;
  text-transform: uppercase;
  text-decoration: none;
  display: block;
  transition:all 0.3s;
}



.navbar {
  background: #E5E5E5;
  padding: 20px;
  position: fixed;
  width: 95%;
  top: 0;
}

.content {
  width: 80%;
  margin: 40px auto;
  padding-top: 75px;
  transition: all 0.5s; 
  position: relative;
  left: 0;
}

/* Hide the checkbox */
#toggle {
  display: none; 
}

/* Use this label to toggle the sliding menu */
label[for="toggle"] {
  cursor: pointer;
  font-size: 30px;
  margin-left: 40px;
}

/* Slide menu when checkbox is checked */
input#toggle:checked + ul.navigation-menu {
  right: 0;
}

/* Also slide content when checkbox is checked */
input#toggle:checked ~ .content {
  left: -45%;
}




              
            
!

JS

              
                
              
            
!
999px

Console