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

              
                <!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link href="https://fonts.googleapis.com/css?family=Righteous" rel="stylesheet">
  <title>Tab navigation</title>
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
</head>
<body>
  <div class="nav">
    <div id="home" class="option"><i class="fas fa-home"></i></div>
    
    <div id ="profile" class="option"> <i class="far fa-id-badge"></i></div>
    
    <div id="settings" class="option"> <i class="fas fa-cogs"></i>
</div>
    
    <div id="gallery" class="option"> <i class="far fa-images"></i></div>
    
    <div id="close" class="option">Close</div>
  </div>
  
  <div class="container">
  <div id="home-box" class="box">
    <h2>Home</h2>
    <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Est ullam quisquam sunt, sapiente expedita maiores fugiat nobis distinctio assumenda laboriosam suscipit vel harum nostrum numquam dicta! Laboriosam autem fugit non.</p><br>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa, beatae. Nobis hic provident adipisci perspiciatis modi dolor eius dolorem asperiores. Minima molestiae ut eaque modi vitae amet nostrum qui voluptatibus.</p>
  </div>
  <div id="profile-box" class="box">
    <h2>Profile</h2>
    <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Totam ut adipisci maiores facilis fugiat, porro facere accusantium repellendus assumenda magnam. Lorem ipsum dolor sit amet consectetur adipisicing elit. Laboriosam, aliquam veniam repellendus animi adipisci nesciunt pariatur voluptate amet neque itaque, sed excepturi corrupti deserunt rerum modi consequuntur id magnam quos reprehenderit ratione maxime in nostrum! Odit veniam possimus perspiciatis velit dolore quam praesentium consectetur recusandae qui, esse, quae, amet a! Quidem unde alias perspiciatis doloribus atque! Pariatur possimus atque sit. Nobis veniam commodi assumenda ipsum aliquam sed nesciunt architecto eius vitae, voluptates praesentium quos, nam ut nihil accusantium perferendis qui. Necessitatibus ad temporibus suscipit! Rerum recusandae dolorem, fugiat nemo ut eius nam, veniam hic ipsam quod optio quae voluptatibus iusto.</p>
  </div>
  <div id="settings-box" class="box">
    <h2>Settings</h2>
    <select>
      <option>Lorem</option>
      <option>Ipsum</option>
    </select>
    <select>
      <option>Lorem</option>
      <option>Ipsum</option>
    </select>
    <form>
  <input type="radio"> Lorem<br>
  <input type="radio"> Ipsum<br>
  <input type="radio"> Dolor<br>  
  <input type="submit" value="Submit">
</form>
  </div>
  <div id="gallery-box" class="box">
    <h2>Gallery</h2>
    <img src="https://source.unsplash.com/random/100x100" alt="Random image from Unsplash">
    <img src="https://source.unsplash.com/random/100x100" alt="Random image from Unsplash">
    <img src="https://source.unsplash.com/random/100x100" alt="Random image from Unsplash">
    <img src="https://source.unsplash.com/random/100x100" alt="Random image from Unsplash">
    <img src="https://source.unsplash.com/random/100x100" alt="Random image from Unsplash">
    <img src="https://source.unsplash.com/random/100x100" alt="Random image from Unsplash">
    </div>
  </div>
</body>
</html>
              
            
!

CSS

              
                $home: rgb(66, 134, 244);
$profile: rgb(200, 66, 244);
$settings: rgb(244, 66, 232);
$gallery: rgb(66, 244, 226);
$close: rgb(255, 255, 153);

*{
  box-sizing:border-box;
}

html,body{
  padding:0;
  margin:0;
  overflow:hidden;
}

.nav{
  width:10vw;
  height:100vh;
  float:left;
}

.option{
  display:block;
  text-align:center;
  font-size:1.5rem;
  padding:40px;
  width:100px;
  height:20%;
  border:black solid 1px;
}

.option:hover{
  cursor:pointer;
}

.box{
  display:none;
  width:400px;
  float:right;
  position:relative;
  margin-top:10px;
  right:40%;
  text-align:center;
  padding:10px;
}

img{
  padding:10px;
}

h2{
  font-family: 'Righteous', cursive;
  letter-spacing:3px;
}

#home{
  background: $home;
}

#home-box{
  background: $home;
}

#profile{
  background: $profile;
}

#profile-box{
  background: $profile;
}

#settings{
  background: $settings;
}

#settings-box{
  background: $settings;
}

#gallery{
  background: $gallery;
}

#gallery-box{
  background: $gallery;
}

#close{
  background: $close;
}

@media (max-width: 450px) {
  html, body{
    overflow: scroll;
  }
    
    .nav {
        width:100%;
        height:100vh;
    }

    .option {
        font-size:3rem;
        padding:20px;
        width:100%;
        height:20%;
        border:black solid 1px;
    }
  
    .box{
      display:none;
      width:50%;
      float:none;
      position:absolute;
      margin-top:0;
      right:0;
      text-align:center;
      padding:10px;
    }

}
              
            
!

JS

              
                $("#home").click(function(){
   $('.box').css('display','none');
   $('#home-box').css('display','block');
});

$("#profile").click(function(){
  $('.box').css('display','none');
  $('#profile-box').css('display','block');
});

$("#settings").click(function(){
  $('.box').css('display','none');
   $('#settings-box').css('display','block');
});

$("#gallery").click(function(){
  $('.box').css('display','none');
   $('#gallery-box').css('display','block');
});

$('#close').click(function(){
  $('.box').css('display', 'none');
})

//This jsfiddle helped me come to a way to hide/show the divs I wanted: http://jsfiddle.net/6UcDR/1/
//I was initially having trouble coming up with a slick way to make the previous box close when another menu item was clicked
              
            
!
999px

Console