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

              
                <header class="navbar-wrapper" role="banner">
  <div class="container">
  <div class="navbar navbar-inverse">
    <div class="navbar-header">
      <button class="navbar-toggle" data-toggle="collapse" data-target=".bs-navbar-collapse">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a href="#" class="goto navbar-brand">Menu Bar</a>
    </div>
    <nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
      <ul class="nav navbar-nav">
        <li>
          <a href="">Item 1</a>
        </li>
        <li>
          <a href="">Item 2</a>
        </li>
        <li>
          <a href="">Item 3</a>
        </li>
        <li>
          <a href="">Item 4</a>
        </li>
        <li>
          <a href="">Item 5</a>
        </li>
      </ul>
    </nav>
    </div></div>
</header>
<div id="scroll-wrap">
  <section id="section-1" class="fill-viewport">
    <div class="container">
      <div class="row">
        <div class='col-md-12 welcome-div'>
          <h2>Welcome Div</h2>
          <p>This even works on all mobiles I've tested! Go on try it...</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
        </div>
      </div>
    </div>
  </section>
  <section class="container">
    <div class="row">
      <div class="col-md-12">
        <h2>App Dev text section</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
      </div>
    </div>
  </section>
  <section class="container">
    <div class="row">
      <div class="col-md-12">
        <h2>App Dev text section</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
      </div>
    </div>
  </section>
  <section class="container">
    <div class="row">
      <div class="col-md-12">
        <h2>App Dev text section</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
      </div>
    </div>
  </section>
  <section class="container">
    <div class="row">
      <div class="col-md-12">
        <h2>App Dev text section</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
      </div>
    </div>
  </section>
  <section class="container">
    <div class="row">
      <div class="col-md-12">
        <h2>App Dev text section</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
      </div>
    </div>
  </section>
</div>
              
            
!

CSS

              
                @import compass

$nav-background-transition: 1s
section.fill-viewport
  height: 800px
#section-1
  width: 100%
  background: #0b486b
  padding: 40px 0 30px 0
  display: table
  color: white
  z-index: 200
  div.welcome-div
    height: 100%
    text-align: cente
header.navbar-wrapper
  @media (max-width: 768px)
    margin: 0
    .container
      padding: 0
  margin-top: 15px
  z-index: 300
  .navbar-toggle
    margin: 8px 15px
  .navbar
    padding: 0px 12px
  @media (min-width: 768px)
    .navbar-collapse
      float: right

@media(min-width: 768px) and (max-width: 992px)
  .navbar-collapse
    padding: 0

#scroll-wrap
  position: absolute
  top: 0
  left: 0
  right: 0
header
  left: 0
  right: 0
  &.affix-top
    position: absolute
    top: 400px
  &.affix
    position: fixed
    top: 0px !important
    
  
@media (max-width: 768px)
  #scroll-wrap
    bottom: 0
    top: 52px
    overflow: scroll
    -webkit-overflow-scrolling: touch
  header
    position: absolute !important
    top: 0px !important
    right: 0
    left: 0
    z-index: 600
    .navbar
      margin-bottom: 0px !important
              
            
!

JS

              
                $(document).ready ->
  $('header').affix
    offset:
      top: -> 400
              
            
!
999px

Console