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

              
                <input type="checkbox" id="nav-toggle">
<nav>
  <label for="nav-toggle" id="toggle"></label>
  <ul>
    <li><a href="#">Search</a></li>
    <li><a href="#">Info</a></li>
    <li><a href="#">Feed</a></li>
    <li><a href="#">Contact</a></li>
  </ul>
</nav>
<div id="main">
  <h1>Pure CSS Mobile Menu</h1>
  <p>Using only CSS, we have mobile menu</p>
  <p>Single-origin coffee cliche retro, cardigan put a bird on it yr vegan chillwave. Ethical small batch Tonx, viral butcher ethnic leggings kale chips 90's fingerstache fashion axe iPhone High Life raw denim. Flannel Portland blog, Schlitz tumblr Vice lo-fi Godard. Austin readymade farm-to-table, sustainable Odd Future banjo brunch helvetica tumblr mixtape direct trade mumblecore +1 90's kogi. Kale chips whatever Echo Park, master cleanse yr occupy readymade disrupt fap freegan chillwave. Cornhole disrupt umami, pitchfork messenger bag beard gastropub gentrify ethnic four loko roof party organic 8-bit chambray. Four loko umami forage butcher Echo Park meggings irony, helvetica next level Portland occupy whatever tumblr plaid Austin.</p>
  <p>Asymmetrical cardigan direct trade, kogi Carles intelligentsia small batch ugh hella tofu mlkshk fingerstache 90's High Life tumblr. Food truck wolf mlkshk biodiesel, semiotics ugh blog Austin. Vice shabby chic Carles wolf. Viral ennui flannel mumblecore Bushwick jean shorts wolf, pitchfork Pinterest banh mi banjo gastropub keffiyeh Marfa literally. Master cleanse food truck artisan bitters. 90's american apparel selvage dreamcatcher intelligentsia Etsy McSweeney's polaroid, Pinterest banjo hashtag actually readymade Carles. Tousled messenger bag meggings, plaid vinyl four loko Bushwick 3 wolf moon butcher Marfa 8-bit readymade.</p>
  <p>Vinyl tousled ethical yr meh. Actually semiotics before they sold out pug, Pinterest blue bottle Etsy cornhole chambray Truffaut ethical. Cliche hella food truck, flannel sriracha twee synth. Asymmetrical High Life banjo, pitchfork organic Banksy synth salvia biodiesel kogi beard craft beer. Tote bag Brooklyn Odd Future, Wes Anderson single-origin coffee High Life hella mlkshk squid hoodie gastropub tousled sustainable Schlitz trust fund. Cray pitchfork PBR, +1 you probably haven't heard of them raw denim asymmetrical Terry Richardson. Cornhole disrupt gentrify, keffiyeh photo booth Marfa vinyl readymade Schlitz squid chambray High Life intelligentsia pug +1.</p>
  <p>Thundercats squid typewriter narwhal asymmetrical fixie. Cardigan hoodie Bushwick Etsy DIY yr. Trust fund fashion axe ennui, craft beer Odd Future organic letterpress. Brunch pitchfork kitsch 3 wolf moon, shoreditch Wes Anderson mumblecore meh literally deep v whatever. Blue bottle quinoa banh mi tousled hoodie meggings. Freegan Truffaut hashtag Echo Park. Before they sold out synth vegan lomo.</p>
</div>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=News+Cycle:400,700);

html,
body {
  height: 100%;
}

body {
  background: #d4e8f8;
  color: #444;
  font-family: 'News Cycle';
  overflow-x: hidden;
}

#nav-toggle {
  position: absolute;
  left: -9999px;
}

nav {
  position: fixed;
  top: 0;
  left: -80%;
  width: 80%;
  height: 100%;
  background: #222;
  transition: transform 0.5s;
  
  #toggle {
    display: block;
    position: absolute;
    top: 0;
    right: -40px;
    width: 40px;
    height: 40px;
    background: #333;
    color: #fff;
    text-align: center;
    line-height: 36px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.5s, right 0.5s;
    
    &:before {
      content: '\2630'; 
    }
    
    &:hover {
      background: #169; 
    }
  }
  
  ul {
    height: 100%;
    border-right: 40px solid #333;
    
    li {
      font-size: 28px;
      text-transform: uppercase;
      background: #444;
      border-top: 1px solid #555;
      border-bottom: 1px solid #333;
      
      a {
        display: block;
        padding: 20px 30px;
        color: #fff;
        text-decoration: none;
      }
      
      &:hover {
        background: #555;
        border-top: 1px solid #666;
      }
    }
  }
  
  #nav-toggle:checked ~ & {
    transform: translate3d(100%, 0, 0);
    
    #toggle {
      right: 0;
      font-size: 28px;
      
      &:before {
        content: '\00D7';
      }
    }
    
    & ~ #main {
      transform: translate3d(90%, 0, 0);
    }
  }
}

#main {
  width: 75%;
  margin: 0 auto;
  padding: 40px 5%;
  transition: transform 0.5s;
}

h1 {
  font-weight: bold;
  font-size: 48px;
  margin-bottom: 8px;
  color: #333;
  text-shadow: 1px 1px 0 #fff;
}

p {
 margin-bottom: 20px; 
}
              
            
!

JS

              
                // NOJS4U
              
            
!
999px

Console