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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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>
  <nav class="navbar fixed-top navbar-toggleable-sm navbar-inverse bg-inverse">
    <div class="container">
      
      <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      
      <a class="navbar-brand" href="#">Smooth</a>
      <div class="collapse navbar-collapse" id="navbarNav">
        
        <ul class="navbar-nav">          
          <li class="nav-item active">
            <a class="nav-link scroll" href="#top">Home</a>
          </li>
          <li class="nav-item">
            <a class="nav-link scroll" href="#features">Features</a>
          </li>
          <li class="nav-item">
            <a class="nav-link scroll" href="#pricing">Pricing</a>
          </li>          
        </ul>
        
      </div>
    </div> <!-- /container -->
  </nav>

</header>

<section class="hero" id="top">
  <div class="container">
    <div class="row">
      <div class="col-lg-12">
        <h1 class="display-3">I like it smooth</h1>
      </div>
    </div>
  </div>
</section>

<section class="features" id="features">
  <div class="container">
    <h1 class="mb-5 display-4">Features</h1>
    <div class="row">
      <div class="col-md-4">
        <h3>Lorem ipsum dolor sit amet</h3>
        <p>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 class="col-md-4">
        <h3>Consectetuer adipiscing elit.</h3>
        <p>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 class="col-md-4">
        <h3>Lorem ipsum dolor sit amet</h3>
        <p>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="pricing" id="pricing">
  <div class="container">
    <h1 class="mb-5 display-4">Pricing</h1>
    <div class="row no-gutters">
      <div class="col-md-4">
        <div class="card bg-info">
          <div class="card-header bg-primary text-white">
            Basic
          </div>
          <div class="card-block">
            <h4 class="card-title">Cool Plan</h4>
            <p class="card-text">
              <ol>
               <li>Lorem ipsum </li>
               <li>Aliquam tincidunt</li>
               <li>Vestibulum auctor.</li>
            </ol>
            </p>
            <a href="#" class="btn btn-primary">Download FREE</a>
          </div>
        </div>
      </div>
      <div class="col-md-4">
        <div class="card featured-price bg-inverse text-white">
          <div class="card-header bg-danger text-uppercase">
            Most Popular
          </div>
          <div class="card-block">
            <h4 class="card-title">Awesome Plan</h4>
            <p class="card-text">
              <ol>
               <li>Lorem ipsum </li>
               <li>Aliquam tincidunt</li>
               <li>Vestibulum auctor.</li>
              </ol>
            </p>
            <a href="#" class="btn btn-danger">Buy now</a>
          </div>
        </div>
      </div>
      <div class="col-md-4">
        <div class="card bg-info">
          <div class="card-header bg-primary text-white">
            Full Deal
          </div>
          <div class="card-block">
            <h4 class="card-title">Amazing Plan</h4>
            <p class="card-text">
              <ol>
                 <li>Lorem ipsum </li>
                 <li>Aliquam tincidunt</li>
                 <li>Vestibulum auctor.</li>
              </ol>
            </p>
            <a href="#" class="btn btn-primary">Buy now</a>
          </div>
        </div>
      </div>
    </div>
  </div>
</section>

<footer>
  <p>generic footer content</p>
</footer>
              
            
!

CSS

              
                $accent: #EF629F;
$secondary: #EECDA3;
$dark: #222;
$medium-dark: lighten($dark, 25%);


@mixin section-padding {
  padding: 10vh 0;
  @media (min-width: 768px) { // I'd prefer this to be the $md Bootstrap grid variable
    padding: 20vh 0;
  }
}

body {
  padding-top: 3rem;
}

.hero {
  padding: 20vh 0;
  background: linear-gradient(to right, $secondary, $accent);
}

.features {
  @include section-padding;
  background: $dark;
  color: white;
}

.pricing {
  @include section-padding;
  text-align: center;
}

.featured-price {
  transform: scale(1.1);
  z-index: 10;
  background: $dark;
}

footer {
  padding: 10vh 0;
  text-align: center;
  background: black;
  color: white;
}
              
            
!

JS

              
                $(document).ready(function() {
  
  var scrollLink = $('.scroll');
  
  // Smooth scrolling
  scrollLink.click(function(e) {
    e.preventDefault();
    $('body,html').animate({
      scrollTop: $(this.hash).offset().top
    }, 1000 );
  });
  
  // Active link switching
  $(window).scroll(function() {
    var scrollbarLocation = $(this).scrollTop();
    
    scrollLink.each(function() {
      
      var sectionOffset = $(this.hash).offset().top - 20;
      
      if ( sectionOffset <= scrollbarLocation ) {
        $(this).parent().addClass('active');
        $(this).parent().siblings().removeClass('active');
      }
    })
    
  })
  
})
              
            
!
999px

Console