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

Details

Privacy

Go PRO Window blinds lowered to protect code. Code Editor with window blinds (raised) and a light blub turned on.

Keep it secret; keep it safe.

Private Pens are hidden everywhere on CodePen, except to you. You can still share them and other people can see them, they just can't find them through searching or browsing.

Upgrade to PRO

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.

Template

Make Template?

Templates are Pens that can be used to start other Pens quickly from the create menu. The new Pen will copy all the code and settings from the template and make a new Pen (that is not a fork). You can view all of your templates, or learn more in the documentation.

Template URL

Any Pen can act as a template (even if you don't flip the toggle above) with a special URL you can use yourself or share with others. Here's this Pen's template URL:

Screenshot

Screenshots of Pens are shown in mobile browsers, RSS feeds, to users who chose images instead of iframes, and in social media sharing.

This Pen is using the default Screenshot, generated by CodePen. Upgrade to PRO to upload your own thumbnail that will be displayed on previews of this pen throughout the site and when sharing to social media.

Upgrade to PRO

HTML

              
                  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap 101 Template</title>

    <!-- Bootstrap -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
    <div class="header">Header</div>
    <div class="nav-wrapper">
      <div class="nav">NavBar</div>
    </div>
    <p>Lorem ipsum dolor sit amet, prima quidam eripuit ne usu, usu viderer nonumes ad. Iisque nostrud his ne, soleat lobortis et eum. Vel graeco salutatus ne, vis ut ferri mollis invenire. Est te sanctus vivendum volutpat, qui vero dolores eligendi id, ea percipitur contentiones vim. Solum nusquam ei nam, pri an odio ancillae.

  Duis volumus sententiae in vix. Qui ei civibus denique, in duo probatus repudiare. Cum at ubique volutpat, quis suscipit democritum duo in, audiam iuvaret vivendo ei qui. Usu eu legere integre reformidans, scaevola deserunt ea mel. Nulla invenire disputationi has te. Dicam malorum nec ex.

  In mel soluta admodum lobortis. Ex verterem abhorreant repudiandae est, his quidam commune eligendi in. Sed vitae nonumy vidisse eu, at semper forensibus vis, vel elit harum id. Ad atqui iisque fabellas vim, at albucius placerat pri. Ut modo ancillae pertinax mei.

  Solum maiorum an vis, ei nam viris oportere. Ad fierent efficiantur nec, adhuc blandit tacimates eu eos. Et nec viderer lucilius tacimates, est ad impedit offendit. Mea option repudiare prodesset an, per id mentitum torquatos repudiandae, cu vim alia purto.

  No eum brute harum, id legere tritani blandit sea. Vel ludus constituam ne, mel cu dignissim accommodare. Doming suscipit ei per, eos decore diceret saperet te. Nec ad natum option, inani accusamus no nec. Mel id saepe scaevola, verear accusam adversarium quo at, vix rebum vivendum ne. Ius denique perfecto deterruisset ad, sit equidem definiebas intellegebat an.</p>
    <p>No eum brute harum, id legere tritani blandit sea. Vel ludus constituam ne, mel cu dignissim accommodare. Doming suscipit ei per, eos decore diceret saperet te. Nec ad natum option, inani accusamus no nec. Mel id saepe scaevola, verear accusam adversarium quo at, vix rebum vivendum ne. Ius denique perfecto deterruisset ad, sit equidem definiebas intellegebat an.No eum brute harum, id legere tritani blandit sea. Vel ludus constituam ne, mel cu dignissim accommodare. Doming suscipit ei per, eos decore diceret saperet te. Nec ad natum option, inani accusamus no nec. Mel id saepe scaevola, verear accusam adversarium quo at, vix rebum vivendum ne. Ius denique perfecto deterruisset ad, sit equidem definiebas intellegebat an.No eum brute harum, id legere tritani blandit sea. Vel ludus constituam ne, mel cu dignissim accommodare. Doming suscipit ei per, eos decore diceret saperet te. Nec ad natum option, inani accusamus no nec. Mel id saepe scaevola, verear accusam adversarium quo at, vix rebum vivendum ne. Ius denique perfecto deterruisset ad, sit equidem definiebas intellegebat an.</p>
    <p>No eum brute harum, id legere tritani blandit sea. Vel ludus constituam ne, mel cu dignissim accommodare. Doming suscipit ei per, eos decore diceret saperet te. Nec ad natum option, inani accusamus no nec. Mel id saepe scaevola, verear accusam adversarium quo at, vix rebum vivendum ne. Ius denique perfecto deterruisset ad, sit equidem definiebas intellegebat an.No eum brute harum, id legere tritani blandit sea. Vel ludus constituam ne, mel cu dignissim accommodare. Doming suscipit ei per, eos decore diceret saperet te. Nec ad natum option, inani accusamus no nec. Mel id saepe scaevola, verear accusam adversarium quo at, vix rebum vivendum ne. Ius denique perfecto deterruisset ad, sit equidem definiebas intellegebat an.No eum brute harum, id legere tritani blandit sea. Vel ludus constituam ne, mel cu dignissim accommodare. Doming suscipit ei per, eos decore diceret saperet te. Nec ad natum option, inani accusamus no nec. Mel id saepe scaevola, verear accusam adversarium quo at, vix rebum vivendum ne. Ius denique perfecto deterruisset ad, sit equidem definiebas intellegebat an.</p> 
    
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
  </body>

              
            
!

CSS

              
                .header {
  height: 100px;
  background-color: rgb(189, 89, 89);
  color: white;
  text-align: center;
  font-size: 18px;
}

.nav {
  background-color: #aaa;
  height: 60px;
  text-align: center;
  font-weight: bold;
  color: white;
}

.nav-wrapper {
  height: 60px;
}

.affix {
  top: 0;
  width: 100%;
}
              
            
!

JS

              
                $(".nav").affix({
  offset: {
    top: 100
  }
});
              
            
!
999px
We would have called your functions earlier, but we were in a bind.

Console