Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <head>
    <link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.css">
</head>
<body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top">

    <!-- Navigation -->
    <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
        <div class="container">
            <div class="navbar-header page-scroll">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-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 class="navbar-brand page-scroll" href="#page-top">Home</a>-->
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse navbar-ex1-collapse">
                <ul class="nav navbar-nav nav-menu">
                    <!-- Hidden li included to remove active class from about link when scrolled up past about section -->
                    <li>
                        <a class="page-scroll" href="#page-top">Home</a>
                    </li>
                    <li>
                        <a class="page-scroll" href="#about">About</a>
                    </li>
                    <li>
                        <a class="page-scroll" href="#services">Services</a>
                    </li>
                    <li>
                        <a class="page-scroll" href="#contact">Contact</a>
                    </li>
                </ul>
            </div>
            
            
            <!-- /.navbar-collapse -->
        </div>
        <!-- /.container -->
    </nav>

    <!-- Intro Section -->
    <section id="intro" class="intro-section">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <h1>One Page Nav & Scrolling Nav</h1>
                    
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iure asperiores expedita vel aut cumque minima, nisi labore laudantium repellat commodi non. Aliquam iure dolorem eaque, temporibus possimus minima laboriosam voluptatibus.</p>
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iure asperiores expedita vel aut cumque minima, nisi labore laudantium repellat commodi non. Aliquam iure dolorem eaque, temporibus possimus minima laboriosam voluptatibus.</p>
                    <a class="btn btn-default page-scroll" href="#about">Click Me to Scroll Down!</a>
                </div>
            </div>
        </div>
    </section>

   
        <nav class="navbar navbar-fixed-top navbar-bg" role="navigation">
            <ul class="nav navbar-nav nav-bullets">
                <li>
                    <a class="page-scroll" href="#page-top"><i class="fa fa-circle"></i></a>
                </li>
                <li>
                    <a class="page-scroll" href="#about"><i class="fa fa-circle"></i></a>
                </li>
                <li>
                    <a class="page-scroll" href="#services"><i class="fa fa-circle"></i></a>
                </li>
                <li>
                    <a class="page-scroll" href="#contact"><i class="fa fa-circle"></i></a>
                </li>
            </ul>
        </nav>
   
    <!-- About Section -->
    <section id="about" class="about-section">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <h1>About Section</h1>
                </div>
            </div>
        </div>
    </section>

    <!-- Services Section -->
    <section id="services" class="services-section">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <h1>Services Section</h1>
                </div>
            </div>
        </div>
    </section>

    <!-- Contact Section -->
    <section id="contact" class="contact-section">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <h1>Contact Section</h1>
                </div>
            </div>
        </div>
    </section>

  <script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
  
  <script src="https://cdn.jsdelivr.net/jquery.easing/1.3/jquery.easing.1.3.min.js"></script>
  
</body>

            
          
!
            
              body {
    width: 100%;
    height: 100%;
}
html {
    width: 100%;
    height: 100%;
}
.active a {
  border-bottom: 4px solid #fff;
}
.nav-bullets > li {
  float: none;
}
.nav-bullets .active a {
  border-bottom: 0px;
}

.navbar-default .nav-bullets li a {
  color: #41825e
}
.nav-bullets a:hover,.nav-bullets .active a {
  background: none!important;
}
.nav.nav-bullets {
  position: fixed;
  right: 0;
  top: 50%;
}
.navbar-bg .navbar-nav > li > a, .navbar-default .navbar-brand {
  color:#999;
}
.navbar-bg {
  background: none repeat scroll 0 0 rgba(0, 0, 0, 0);
  border: medium none ;
  margin: 0 ;
  min-height: 0 ;
  padding: 0 ;
  position: absolute;
}
.navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:focus, .navbar-default .navbar-nav > .active > a:hover {
  background: none;
  color: #fff;
}
.navbar-bg .navbar-nav > .active > a, .navbar-bg .navbar-nav > .active > a:focus, .navbar-bg .navbar-nav > .active > a:hover {
  background: none;
  color: #41825e;
}
.navbar {
  padding: 20px 0 0 0;
}
.top-nav-collapse {
  padding: 0;
}
.navbar-default {
  background: rgba(65,130,94,.8);
}
.navbar-default .navbar-nav > li > a,.navbar-default .navbar-brand  {
  color: #fff;
}
.intro-section {
    height: 100%;
    padding-top: 150px;
    text-align: center;
    background: #fff;
}
.about-section {
    height: 100%;
    padding-top: 150px;
    text-align: center;
    background: #eee;
}
.services-section {
    height: 100%;
    padding-top: 150px;
    text-align: center;
    background: #fff;
}
.contact-section {
    height: 100%;
    padding-top: 150px;
    text-align: center;
    background: #eee;
}


/*================== responsive css ==================*/
@media(min-width:767px) {
    .navbar {
        -webkit-transition: background .5s ease-in-out,padding .5s ease-in-out;
        -moz-transition: background .5s ease-in-out,padding .5s ease-in-out;
        transition: background .5s ease-in-out,padding .5s ease-in-out;
    }

    .top-nav-collapse {
        padding: 0;
    }
    .nav.nav-bullets {
      right: 20px;
    }
}
@media(max-width:767px) {   
    .nav.nav-bullets {
      right: 20px;
    }
}
            
          
!
            
              //jQuery to collapse the navbar on scroll
$(window).scroll(function() {
    if ($(".navbar").offset().top > 50) {
        $(".navbar-fixed-top").addClass("top-nav-collapse");
    } else {
        $(".navbar-fixed-top").removeClass("top-nav-collapse");
    }
});

//jQuery for page scrolling feature - requires jQuery Easing plugin
$(function() {
    $('a.page-scroll').bind('click', function(event) {
        var $anchor = $(this);
        $('html, body').stop().animate({
            scrollTop: $($anchor.attr('href')).offset().top
        }, 1500, 'easeInOutExpo');
        event.preventDefault();
    });
});

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console