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

              
                <head>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
</head>

<div class="text-center" id="header">
  <h1>Abiclass</h1>
  <h2>Classes for awesome people</h2>
</div>

<div id="body">
  <nav class="navbar navbar-default navbar-static-top">
    <div class="container-fluid">
      <!-- Brand and toggle get grouped for better mobile display -->
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="#">Abiclass</a>
      </div>
      <ul class="nav navbar-nav navbar-right" id="bs-example-navbar-collapse-1">
        <li><a href="#">Home</a></li>
        <li><a href="#bottom">Bottom</a></li>
        <li><a href="#">Link</a></li>
      </ul>
    </div>
  </nav>

  <div id="main">
    <div class="container">
      <div class="row">
        <div class="col-md-6">
          <h2>Heading Left</h2>
          <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Unde quasi, praesentium est quis molestias aliquid sint repellat necessitatibus temporibus! Quod molestias harum placeat sed labore voluptatem ab, fugiat doloribus perferendis!</p>
          <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempore maxime quod magni voluptatum dolorum, facilis suscipit obcaecati animi hic natus assumenda nisi. Quasi debitis, quae hic iusto, necessitatibus dicta dolore.</p>
          <ul>
            <li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
            <li>Aliquam tincidunt mauris eu risus.</li>
            <li>Vestibulum auctor dapibus neque.</li>
          </ul>  
          <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Unde est, sapiente. Dignissimos corporis facilis cum voluptate distinctio dolore velit modi, quasi eius minima aspernatur ratione accusantium cumque! Exercitationem, libero, quam. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolores doloremque a incidunt fugit facilis atque facere enim neque eum sed iste vitae quas temporibus, harum quod hic molestiae, nihil sit.</p>
        </div>
        <div class="col-md-6">
          <h2>Heading Right</h2>
          <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Pariatur alias non quam eligendi quasi dignissimos omnis id minima sequi aliquam, dolore placeat, quae repudiandae quas necessitatibus repellendus! Impedit, praesentium voluptatibus.</p>
          <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Harum, molestias, dolorem praesentium itaque sit impedit tempore, unde perferendis quia vitae odit. Ducimus fugit architecto laudantium ex et minima. Culpa, exercitationem.</p>
          <img src="https://unsplash.it/600/400?image=0" class="img-responsive" />
        </div>
      </div><!-- /.row-->
      <div class="row" id="bottom">
        <h2>Heading Bottom</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Veritatis quidem totam ad molestiae et, odit voluptates debitis, distinctio autem odio voluptas quasi sed impedit pariatur ex laborum corrupti, fugit vitae! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laboriosam nisi sit quae, delectus aspernatur quibusdam quasi fugit nesciunt. Repellendus dignissimos fugiat voluptatibus temporibus fugit aut magnam ratione, laudantium, unde amet?</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae ipsa aut suscipit laborum voluptatum enim iure laudantium officiis, officia non nesciunt fugit dolorum consectetur minus perferendis aperiam! Amet, tempora, optio. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quae reiciendis eos ex! Atque maiores deleniti, voluptatem repudiandae incidunt eaque repellendus vitae sequi. Vitae quam maiores similique, eum tempora hic distinctio.</p>
        <div class="text-center">
          <img src="https://unsplash.it/800/400?image=694" alt="" class="img-responsive"/>
        </div>
      </div>
    </div>
  </div> <!--/#main-->
</div><!-- /#body-->
              
            
!

CSS

              
                #body {
  margin: 0;
  padding-top: 330px;
  background-color:#fff;
}
#header{
  padding-top:100px;
  height:330px;
  width:100%;
  background: url('https://unsplash.it/600/200?image=668') center;
  background-size: cover;
  background-color:#009999;
  color:#fff;
  text-shadow: 2px 2px 2px rgba(0,0,0,0.5);
}
#header{
  position: fixed;
  width: 100%;
  top: 0;
}
.navbar,
#main {
  position: relative; 
}
.navbar.navbar-default {
  z-index: 150;
  margin-bottom: -50px;
  box-shadow: 0 2px 3px rgba(0,0,0,.4);
}
#main {
  background-color: #fff;
  padding:100px 0 50px 0;
}
              
            
!

JS

              
                var  mn = $(".navbar.navbar-default");
var  mns = "navbar-fixed-top";
var  hdr = $('#header').height(); 

$(window).scroll(function() {
  if( $(this).scrollTop() > (hdr+80) ) {
    mn.addClass(mns);
  } else {
    mn.removeClass(mns);
  }
});
              
            
!
999px

Console