Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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>
  <h1>This is a <strong>header</strong></h1>
</header>
<nav>
  <div class="container">
    <ul>
     <li><a href="#home">Home</i>
      <li><a href="#about">About Us</a></li>
      <li><a href="#services">Services</a></li>
      <li><a href="#contact">Contact Us</a></li>
     </ul>
  </div>
 </nav>
<section id="home">
  <article class="container">
    <h2>Home</h2>
   We got no food we got no money and our pets heads are falling off! Haaaaaaarry. It's because i'm green isn't it! Your entrance was good, his was better. Hey, maybe I will give you a call sometime. Your number still 911? I just heard about evans new position,good luck to you evan backstabber, bastard, i mean baxter. Hey, maybe I will give you a call sometime. Your number still 911?  
   </article>
  </section>

<section id="about">
  <article class="container">
    <h2>About</h2>
   We got no food we got no money and our pets heads are falling off! Haaaaaaarry. It's because i'm green isn't it! Your entrance was good, his was better. Hey, maybe I will give you a call sometime. Your number still 911? I just heard about evans new position,good luck to you evan backstabber, bastard, i mean baxter. Hey, maybe I will give you a call sometime. Your number still 911?  
   </article>
  </section>

<section id="services">
  <article class="container">
    <h2>Services</h2>
   We got no food we got no money and our pets heads are falling off! Haaaaaaarry. It's because i'm green isn't it! Your entrance was good, his was better. Hey, maybe I will give you a call sometime. Your number still 911? I just heard about evans new position,good luck to you evan backstabber, bastard, i mean baxter. Hey, maybe I will give you a call sometime. Your number still 911?  
   </article>
  </section>

<section id="contact">
  <article class="container">
    <h2>Contact</h2>
   We got no food we got no money and our pets heads are falling off! Haaaaaaarry. It's because i'm green isn't it! Your entrance was good, his was better. Hey, maybe I will give you a call sometime. Your number still 911? I just heard about evans new position,good luck to you evan backstabber, bastard, i mean baxter. Hey, maybe I will give you a call sometime. Your number still 911?  
   </article>
  </section>
              
            
!

CSS

              
                html, body{
 margin: 0px;
 padding: 0px;
 font-family: 'Lato',sans-serif;
  font-size: 18px;
  font-weight: 300;
  height: 100%;
  color: #fff;
  background: #fbfbfb;
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  transition: all 0.3s ease-in-out;
}

h1, h2{
  text-align: center;
}

h2{
  color: #1abc9c;
}

.container{
  width: 1000px;
  max-width: 100%;
  margin: auto;
}

header{
  width: 100%;
  height: 100%;
  position: relative;
  background: #1abc9c;
  
  h1{
    font-size: 50px;
    font-weight: 300;
    margin: auto;
    padding: 0;
    
    position: absolute;
    left: 50%;
    top: 50%;
    -webkit-transform: translate3d(-50%,-50%,0);
    transform: translate3d(-50%,-50%,0);
  }
}

nav{
  background: #fff;
  clear: both;
  overflow: hidden;
  
  ul{
    list-style: none;
    margin: 0;
    padding: 0;
    
    li{
      float: left;
      
      a{
        display: block;
        padding: 25px 20px;
        text-decoration: none;
        color: #1abc9c;
        font-weight: normal;
        
        &:hover{
          background: #eee;
        }
      }
    }
  }
}

section{
  
  width: 100%;
  height: 50%;
    color: #444;
  
  article{
    padding: 50px 0;
  }
}

section:nth-of-type(odd){
  background: #fff;
}

/*helper*/
.isFixed{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: 0 2px 0 #eee;
}
.whiteSpace{
  margin-top: 60px;
  -webkit-transition: none;
  transition: none;
}

/*font-face*/
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 100;
  src: local('Lato Hairline'), local('Lato-Hairline'), url(http://themes.googleusercontent.com/static/fonts/lato/v6/boeCNmOCCh-EWFLSfVffDg.woff) format('woff');
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 300;
  src: local('Lato Light'), local('Lato-Light'), url(http://themes.googleusercontent.com/static/fonts/lato/v6/KT3KS9Aol4WfR6Vas8kNcg.woff) format('woff');
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: local('Lato Regular'), local('Lato-Regular'), url(http://themes.googleusercontent.com/static/fonts/lato/v6/9k-RPmcnxYEPm8CNFsH2gg.woff) format('woff');
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  src: local('Lato Bold'), local('Lato-Bold'), url(http://themes.googleusercontent.com/static/fonts/lato/v6/wkfQbvfT_02e2IWO3yYueQ.woff) format('woff');
}

              
            
!

JS

              
                $('a[href^="#"]').click(function(event) {
		var id = $(this).attr("href");
		var target = $(id).offset().top;
		$('html, body').animate({scrollTop:target}, 500);
		event.preventDefault();
	});

var offset = $('nav').offset().top;
$(window).scroll(function() {
  if($(this).scrollTop() >= offset) {
   $('nav').addClass('isFixed');
    $('html').addClass('whiteSpace');
  } else {
    $('nav').removeClass('isFixed');
     $('html').removeClass('whiteSpace');
  }
});
              
            
!
999px

Console