css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <head>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  <link href='https://fonts.googleapis.com/css?family=Roboto:400,700' rel='stylesheet'>
</head>

<div class="site-container">
  <div class="site-pusher">
    
    <header class="header">
      
      <a href="#" class="header__icon" id="header__icon"></a>
      <a href="#" class="header__logo">Logo</a>
      
      <nav class="menu">
        <a href="#">Home</a>
        <a href="#">About</a>
        <a href="#">Blog</a>
        <a href="#">Contact</a>
      </nav>
      
    </header>

    <div class="site-content">
      <div class="container">
        
        <h1>Responsive Navigation Bar</h1>
        <p>Tutorial by Grafikart.fr 
          <a href="https://www.youtube.com/watch?v=_X2N_yw9Boo" target="_blank" style="color: blue">https://www.youtube.com/watch?v=_X2N_yw9Boo</a>
        </p>
        <p>UI Color Palette from 
          <a href="https://www.google.com/design/spec/style/color.html" target="_blank" style="color: blue">Google Material Design</a>
        </p>
        
        <h2>Animals</h2>
        <ul>
          <li>Sabre-Toothed Tiger</li>
          <li>Old English Sheepdog</li>
          <li>Little Penguin</li>
          <li>Striped Rocket Frog</li>
          <li>Snapping Turtle</li>
        </ul>
        
        <h2 style="background-color: #fff176; display: inline">Hint</h2>
        <p>Resize the browser window to toggle</p>
        
        <h2>Breakfast</h2>
        <figure>
          <a href="http://commons.wikimedia.org/wiki/File:Grilled_ham_and_cheese_014.JPG" target="_blank">
            <img src="http://upload.wikimedia.org/wikipedia/commons/5/50/Grilled_ham_and_cheese_014.JPG" alt="By Glenlarson at English Wikipedia (en.wikipedia) [Public domain], via Wikimedia Commons" style="width: 100%; height: auto;">
          </a>
          <figcaption style="font-size: smaller">Breakfast.01 - The picture above has cheese though, mine has no cheese.</figcaption>
        </figure>
        <p>I make ham sandwiches in the morning with toasted bread and a cup of fresh milk every weekend.</p>
        <p>Bacon ipsum dolor sit amet beef kielbasa pancetta sirloin, landjaeger sausage kevin hamburger frankfurter ham.Consequat laborum ham hock culpa pork filet mignon kevin, ribeye leberkas sed tri-tip corned beef ut dolore exercitation.</p>
        <p>Ground round chicken cow, tongue porchetta sirloin salami kielbasa pork prosciutto venison pork chop capicola.</p>
        
      </div> <!-- END container -->
    </div> <!-- END site-content -->
    <div class="site-cache" id="site-cache"></div>
  </div> <!-- END site-pusher -->
</div> <!-- END site-container -->

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
            
          
!
            
              @import "compass/css3";

@import "compass";

/* VARIABLES */
$header-bg: #3f51b5;
$menu-width: 250px!default;

/* BASE */
html,
body {
  font-family: 'Roboto', sans-serif;
  font-size: 1em;
  line-height: 1.4;
  height: 100%;
  
  margin: 0;
  padding: 0;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  @include clearfix;
  margin: 0 20px;
}

.site-content {
  padding-top: 66px;
}

/* HEADER */
.header {
  position: fixed;
  left: 0;
  right: 0;
  height: 66px;
  
  line-height: 66px;
  color: #fff;
  
  background-color: $header-bg;
}

.header__logo {
  font-weight: 700;
  padding: 0 25px;
  float: left;
}

/* MENU */
.menu {
  float: left;
  
  a {
    padding: 0 10px;
  }
  
  a:hover {
    color: #c5cae9;
  }
}

/* RESPONSIVE */
@media only screen and (max-width: 768px) {
  .site-pusher,
  .site-container {
    height: 100%;
  }
  
  .site-container {
    overflow: hidden;
  }
  
  .site-pusher {
    @include transition-duration(0.3s);
    @include transform(translateX(0px));
  }
  
  .site-content {
    position: absolute;
    top: 66px;
    right: 0;
    left: 0;
    bottom: 0;
    padding-top: 0;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
  }
  
  .header {
    position: static;
  }
  
  .header__icon {
    position: relative;
    display: block;
    float: left;
    width: 50px;
    height: 66px;
    
    cursor: pointer;
    
    &:after {
      content: '';
      position: absolute;
      display: block;
      width: 1rem;
      height: 0;
      top: 16px;
      left: 15px;
      @include box-shadow(0 10px 0 1px #fff, 0 16px 0 1px #fff, 0 22px 0 1px #fff);
    }
  }
  
  .menu {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background-color: darken($header-bg, 5);
/*    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;*/
    
    width: $menu-width;
    
    @include transform(translateX($menu-width * -1));
    a {
      display: block;
      height: 40px;
      
      text-align: center;
      line-height: 40px;
      
      border-bottom: 1px solid $header-bg;
    }
  }
  
  .with--sidebar {
    .site-pusher {
      @include transform(translateX($menu-width));
    }
    .site-cache {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: rgba(0,0,0,0.6);
    }
  }
}
            
          
!
            
              $(document).ready(function(){

	(function($) {

		$('#header__icon').click(function(e){
			e.preventDefault();
			$('body').toggleClass('with--sidebar');
		});
    
    $('#site-cache').click(function(e){
      $('body').removeClass('with--sidebar');
    });

	})(jQuery);

});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console