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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <header class="header-base">
  <h1>CSS Slide Nav</h1>
</header>

<div class="page">

  <input type="radio" name="nav" class="hide-radio" id="first" checked />
  <input type="radio" name="nav" class="hide-radio" id="second" />
  <input type="radio" name="nav" class="hide-radio" id="third" />

  <nav class="nav-main" role="navigation">
    <ul class="nav-list">
      <li>
        <label for="first" class="nav-item first">
          <span class="label-text">First</span>
        </label>
      </li>
      <li>
        <label for="second" class="nav-item second">
          <span class="label-text">Second</span>
        </label>
      </li>
      <li>
        <label for="third" class="nav-item third">
          <span class="label-text">Third</span>
        </label>
      </li>
    </ul>
  </nav>

  <div class="one slide">
    <div class="content">
      <h1>Page 1</h1>
      <p>
        Bacon ipsum dolor sit amet laborum biltong meatball, flank minim anim ground round qui drumstick sint pork chop filet mignon fatback bacon. Biltong consequat sausage aliquip minim. Meatloaf do exercitation in, non ullamco proident irure. Ribeye deserunt velit officia. Labore jerky mollit voluptate.
      </p>
      <p>
        Excepteur adipisicing tongue, sirloin occaecat anim esse kevin. Biltong cillum flank voluptate, short loin swine veniam proident sunt ut ad nulla. Shank sirloin enim nulla. Jowl sed turducken, filet mignon ut shankle nostrud. In adipisicing in ham cillum, est tongue aliquip ullamco ut brisket ut bacon. Occaecat qui ad turducken. Consequat jowl sunt nostrud dolor meatball minim corned beef.
      </p>
    </div>
  </div>

  <div class="two slide">
    <div class="content">
      <h2>Page 2</h2>
      <p>
        Bacon ipsum dolor sit amet laborum biltong meatball, flank minim anim ground round qui drumstick sint pork chop filet mignon fatback bacon. Biltong consequat sausage aliquip minim. Meatloaf do exercitation in, non ullamco proident irure. Ribeye deserunt velit officia. Labore jerky mollit voluptate.
      </p>
      <p>
        Excepteur adipisicing tongue, sirloin occaecat anim esse kevin. Biltong cillum flank voluptate, short loin swine veniam proident sunt ut ad nulla. Shank sirloin enim nulla. Jowl sed turducken, filet mignon ut shankle nostrud. In adipisicing in ham cillum, est tongue aliquip ullamco ut brisket ut bacon. Occaecat qui ad turducken. Consequat jowl sunt nostrud dolor meatball minim corned beef.
      </p>
      <p>
        Consectetur tenderloin et shankle kielbasa culpa, ex chuck duis. Qui aliqua duis sirloin commodo bacon id magna pork loin pancetta ea ground round salami excepteur short ribs. Velit pancetta t-bone pariatur. Incididunt frankfurter chicken magna venison veniam rump. Pork loin adipisicing excepteur tail landjaeger filet mignon.
      </p>
    </div>
  </div>

  <div class="three slide">
    <div class="content">
      <h2>Page 3</h2>
      <p>
        Consectetur tenderloin et shankle kielbasa culpa, ex chuck duis. Qui aliqua duis sirloin commodo bacon id magna pork loin pancetta ea ground round salami excepteur short ribs. Velit pancetta t-bone pariatur. Incididunt frankfurter chicken magna venison veniam rump. Pork loin adipisicing excepteur tail landjaeger filet mignon.
      </p>
    </div>
  </div>

</div> <!-- end .page -->
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Open+Sans);

*, *:after, *:before {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box
}

html, body {
  height: 100%;
}

body {
  background: #dedede;
  color: #02303F;
  font: normal 1em/1.5 "Open Sans";
  margin: 0;
  padding: 0;
  text-shadow: 0 1px rgba(255,255,255,.65);
}

a {
  color: #444;
}

.page {
  height: 100%;
  position: relative;
  overflow: hidden;
}

.header-base {
  background: salmon;
  border-bottom: 1px solid #aaa;
  height: 90px;
  left: 0;
  position: fixed;
  text-align: center;
  top: 0;
  width: 100%;
  z-index: 3
}


/*
  *************************************************************
*  Navigation
  *************************************************************
*/

.hide-radio {
  left: -99999px;
  position: absolute;
  visibility: hidden;
}

.nav-main {
  bottom: 0;
  left: 0;
  position: fixed;
  width: 100%;
  z-index: 6;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list li {
  float: left;
  height: 40px;
  padding: 10px 10px 0;
  position: relative;
  width: 33.3333%;
}

.nav-item {
  background: #fff;
  bottom: 0;
  cursor: pointer;
  left: 0;
  height: 36%;
  padding-top: 20px;
  position: absolute;
  transition: all 0.3s linear;
  width: 100%;
}

.label-text {
  left: 5px;
  position: absolute;
  top: 2px;
}

#first:checked ~ .nav-main .first,
#second:checked ~ .nav-main .second,
#third:checked ~ .nav-main .third{
  height: 100%;
  text-shadow: 0 0 1px rgba(255,255,255,.7);
}


#first:checked ~ .nav-main .first {
  background: salmon;
}
#second:checked ~ .nav-main .second {
  background: salmon;
}
#third:checked ~ .nav-main .third {
  background: salmon;
}


/* end nav items */



.slide {
  background: #aaa;
  height: calc(100% - 90px);
  margin-top: 90px;
  padding: 40px;
  position: absolute;
  transition:  all 0.4s ease-in;
  width: 100%
}

.content {
  padding-bottom: 60px;
}

.two {
  left: 100%;
}

.three {
  left: 200%;
}

#first:checked ~ .one {
  left: 0;
  overflow: auto;
}

#second:checked ~ .one {
  left: -100%;
}

#second:checked ~ .two {
  background: rgba(0,25,250,.05);
  left: 0;
  overflow: auto;
}

#second:checked ~ .three {
  left: 100%;
}

#third:checked ~ .one {
  left: -200%;
}

#third:checked ~ .two {
  left: -100%;
}

#third:checked ~ .three {
  background: rgba(200,10,20,.05);
  left: 0;
  overflow: auto;
}

              
            
!

JS

              
                // Demo by Scott O'Hara.
// See article: http://www.sitepoint.com/you-can-do-that-with-css/
              
            
!
999px

Console