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

              
                <div class="dropdown">
  <input type="checkbox" id="checkbox_toggle">
  <label for="checkbox_toggle" class="hamburger">
      <div class="line line-1"></div>
      <div class="line line-2"></div>
      <div class="line line-3"></div>
   </label>
  <nav>
    <ul>
    <li><a href="#">Link One</a></li>
    <li><a href="#">Link Two</a></li>
    <li><a href="#">Link Three</a></li>
    <li><a href="#">Link Four</a></li>
  </ul>
    </nav>
</div>
<div class="page-content">
  <h1>PURE CSS MOBILE MENU</h1>
  <p>This is a demo of the checkbox hack. No javascript needed.</p>
</div>
              
            
!

CSS

              
                @import'https://fonts.googleapis.com/css?family=Oswald|Nunito';
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Oswald;
  color: #2d2d2d;
  cursor: default;
}

body {
  background-color: #fcfafc;
  padding: .875rem;
}
p{
  margin-top: .125rem;
    font-family: Nunito;
  
}
a{
  cursor: pointer;
}
input[type=checkbox] {
  display: none;
}

nav ul {
  max-height: 0px;
  overflow: hidden;
  list-style: none;
  transition: all 1s cubic-bezier(.325, 1, .22, 1);
}

nav li {
  border-bottom: .18rem solid #fff;
  color: #fff;
  font-size: 16px;
  padding: 5px 0;
  display: flex;
  justify-content: center;
}

nav li:last-of-type {
  margin-bottom: .625rem;
}

nav li a {
  font-family: Nunito;
  text-decoration: none;
}
nav li a:hover{
  text-decoration: underline;
}

input[type=checkbox]:checked ~ nav ul {
  height: auto;
  max-height: 12rem;
  transition: all 1s cubic-bezier(.5, 1, .22, 1);
}

.hamburger {
  display: block;
  position: absolute;
  top: 18px;
  right: 13px;
  height: 27px;
  width: 27px;
  cursor: pointer;
  transition: all 1s cubic-bezier(.19, 1, .22, 1);
}

.line {
  position: absolute;
  display: block;
  background: #3d3d3d;
  width: 18px;
  height: .15rem;
  border-radius: .2rem;
  left: 0;
  transition: all .6s cubic-bezier(.5, .1, 0, 1.2);
}

.line-1 {
  top: 0;
}

.line-2 {
  top: 7px;
  width: 14px;
  transform: translateX(2px);
  -webkit-transform: translateX(2px);
}

.line-3 {
  top: 14px;
}

input[type=checkbox]:checked ~ label .line-1 {
  top: 0px;
  width: 22px;
  transform: translateX(-11px) rotate(-45deg) translateY(12px);
}

input[type=checkbox]:checked ~ label .line-2 {
  opacity: 0;
}

input[type=checkbox]:checked ~ label .line-3 {
  top: 14px;
  width: 22px;
  transform: translateX(-8px) rotate(45deg) translateY(-8px);
}
              
            
!

JS

              
                /* no active class toggling hulabalo */
              
            
!
999px

Console