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-expand" class="invis" />
    <nav class="nav-side">
      <label for="nav-expand" class="btn-label">
        Menu
      </label>

      <ul class="menu-list">
        <li>
          <a href="#!" title="descriptive title">
            Link Label
          </a>
        </li>
        <li>
          <a href="#!" title="descriptive title">
            ಠ_ಠ Link Label
          </a>
        </li>
        <li>
          <a href="#!" title="descriptive title">
            Link Label
          </a>
        </li>
        <li>
          <a href="#!" title="descriptive title">
            Link Label
          </a>
        </li>
        <li>
          <a href="#!" title="descriptive title">
            Link Label
          </a>
        </li>
        <li>
          <a href="#!" title="descriptive title">
            Link Label
          </a>
        </li>
      </ul>
    </nav>

    <main class="main-base" role="main">
      <header class="header-base" role="banner">
        <div class="content">
          <h1>
            Display Sidebar/Settings on Click/Press of Icon
          </h1>
        </div>
      </header>

      <article>
        <div class="content">
          <p>
            Bacon ipsum dolor sit amet filet mignon prosciutto ham hock boudin pork chop swine shoulder beef. Flank andouille ground round strip steak pork bacon venison ham hock, tongue turducken. Venison jowl hamburger salami bacon capicola. Chuck ribeye sirloin spare ribs, venison beef t-bone prosciutto swine strip steak. Chuck jowl spare ribs tenderloin prosciutto. Pancetta pork chop venison bacon short ribs porchetta. Short loin short ribs kielbasa biltong t-bone tail brisket porchetta pork pork loin chicken.
          </p>
          <p>
            Pork belly meatball sirloin ribeye pork loin meatloaf. Tongue kielbasa chuck sausage, turducken jerky hamburger t-bone fatback frankfurter pork loin pig venison tail. Sirloin tri-tip kevin shankle salami doner jerky capicola leberkas tongue drumstick. Tongue turkey prosciutto salami tri-tip. Shank doner sirloin landjaeger pancetta beef ribs.
          </p>
          <p>
            Frankfurter pork loin short ribs andouille kevin. T-bone tail pig chuck prosciutto brisket. Landjaeger tail fatback beef porchetta, biltong shoulder turkey shankle kevin jowl pancetta brisket pork belly boudin. Short loin tenderloin swine, hamburger bresaola rump shank ground round ham kielbasa chicken pancetta capicola. Boudin chicken frankfurter, pig kielbasa flank ball tip. Corned beef pastrami landjaeger, meatloaf flank shankle pig meatball chuck pork loin swine.
          </p>
          <p>
            Pork belly meatball sirloin ribeye pork loin meatloaf. Tongue kielbasa chuck sausage, turducken jerky hamburger t-bone fatback frankfurter pork loin pig venison tail. Sirloin tri-tip kevin shankle salami doner jerky capicola leberkas tongue drumstick. Tongue turkey prosciutto salami tri-tip. Shank doner sirloin landjaeger pancetta beef ribs.
          </p>
          <p>
            Frankfurter pork loin short ribs andouille kevin. T-bone tail pig chuck prosciutto brisket. Landjaeger tail fatback beef porchetta, biltong shoulder turkey shankle kevin jowl pancetta brisket pork belly boudin. Short loin tenderloin swine, hamburger bresaola rump shank ground round ham kielbasa chicken pancetta capicola. Boudin chicken frankfurter, pig kielbasa flank ball tip. Corned beef pastrami landjaeger, meatloaf flank shankle pig meatball chuck pork loin swine.
          </p>
        </div>
      </article>

      <footer>
        <div class="content">
          <p>
            Oh bai
          </p>
        </div>
      </footer>
    </main>
              
            
!

CSS

              
                *, *::after, *::before {
  box-sizing: border-box;
  font-family: arial;
  line-height: 2;
  margin: 0;
}

body {
  background: #333;
  overflow-x: hidden;
  
  @media screen and (max-width: 500px) {
    font-size: 80%;
  }
}

p {
  margin-bottom: 24px;

  &:last-child {
    margin-bottom: 0;
  }
}

.content {
  margin: auto;
  max-width: 1000px;
  padding: 20px;
}

.invis {
  height: 1px;
  position: absolute;
  overflow: hidden;
  opacity: 0;
  width: 1px;
}

.invis:focus + .nav-side label {
  outline: 4px solid #000;
  outline-offset: -4px;
}

.main-base {
  background: #ddd;
  left: 0px;
  position: relative;
  transition: all .3s;

  header, footer {
    background: #aaa;
    color: #fff;
  }
}

footer a {
  color: #fff;
}

.nav-side {
  background: #E85657;
  color: #fff;
  bottom: 80px;
  box-shadow: 0 0 10px rgba(0,0,0,.1);
  height: 80px;
  left: 40px;
  overflow: hidden;
  padding: 8px 0;
  position: fixed;
  transition: all .3s;
  width: 80px;
  z-index: 2;
}

.menu-list {
  height: 0%;
  list-style: none;
  margin: 0;
  overflow: hidden;
  padding: 0;
  visibility: hidden;
  transition: all .3s;

  a {
    border-bottom: 1px solid #eee;
    color: #fff;
    display: block;
    padding: 12px 8px;
    text-decoration: none;

    &:hover,
    &:focus {
      background: rgba(0,0,0,.5);
    }
  }
}

.btn-label {
  cursor: pointer;
  text-align: center;
  display: block;
  height: calc(100% + 16px);
  margin-top: -8px;
  
  &:hover {
    background: rgba(0,0,0,.2);
  }
}


#nav-expand:checked + .nav-side {
  bottom: 0;
  height: 100%;
  left: 0;
  width: 200px;

  .menu-list {
    height: 100%;
    visibility: visible;
  }

  .btn-label {
    color: transparent;
    display: inline-block;
    height: 20px;
    overflow: hidden;
    line-height: 20px;
    text-align: center;
    width: 20px;

    &:hover {
      background: #eee;
    }

    &::before {
      color: #000;
      content: "X";
      line-height: 20px;
    }
  }


  + .main-base {
    left: 200px;
  }
}


              
            
!

JS

              
                /*
  this demo uses a checkbox and hacky css to simulate what some simple JavaScript and a button could/should do.
  
  this is not code to be used in production.
*/
              
            
!
999px

Console