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 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

              
                
<html>
<head>
	<title>Sticky Navigation</title>
	<link href="css/style.css" rel="stylesheet">
  <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
	<link href='https://fonts.googleapis.com/css?family=Lato:400,700,900' rel='stylesheet' type='text/css'>
	<link href="css/font-awesome.min.css" rel="stylesheet">
</head>
<body>
	<header id="top">
	  <h1>Sticky Navigation</h1>
	  <p>Recreated <i class="fa fa-heart-o"></i> by Kelvin</p>
	  <p>Scroll down</p>

	  <a href="#wrapper">
		  <div class="mouse">
			<div class="wheel"></div>
		  </div>
	  </a>
	</header>
	<nav>
		<div class="nav-items">
			<a href="#home">Home</a>
			<a href="#features">Features</a>
		</div>

		<h1 class="nav-logo">sticky</h1>

		<div class="nav-items">
		  <a href="#work">Work</a>
		  <a href="#info">Info</a>
	  	</div>
	</nav>
	<div class="wrapper" id="wrapper">
		<div id="home">
		  <h2>Home</h2>
		  <p>Curabitur non pellentesque eros. Donec a dictum massa. Cras gravida nisl metus, quis consequat mauris porttitor nec. Morbi malesuada nulla sed mi porttitor sollicitudin. Phasellus pellentesque lorem nisi. In varius fringilla risus, nec elementum metus feugiat ac. Suspendisse non nisi eget augue tincidunt ultrices. Fusce id dapibus ligula. Vivamus interdum in arcu id sollicitudin. Nulla vel turpis sapien. Aliquam id iaculis dui. Donec vitae volutpat massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In eget maximus velit. Aliquam vel tempus mauris. Duis ut pharetra nibh.</p>

		  <p>Integer pretium purus et lorem posuere, ut porttitor nisi posuere. Mauris consectetur massa ut tellus condimentum, non sagittis velit fringilla. Ut fermentum quam ac odio pharetra facilisis. Quisque facilisis quam massa, id finibus dolor ullamcorper et. Donec metus sem, tincidunt vel tellus in, viverra auctor nunc. Suspendisse potenti. Integer lobortis pharetra tristique. Duis in eleifend augue, id ullamcorper lectus. Aenean felis purus, tincidunt vitae porttitor non, vulputate non metus.</p>
	  	</div>

	  	<div id="features">
		  <h2>Features</h2>
		  <p>Nulla finibus, libero ac porta tristique, metus nunc suscipit magna, ut eleifend nisl nunc at dolor. Morbi lobortis pellentesque massa vel placerat. Duis vel est elit. Etiam nec arcu ac elit fermentum pellentesque. Nulla laoreet vulputate sem in eleifend. Suspendisse fermentum nulla sed neque ultricies, ac congue massa lobortis. Maecenas sollicitudin nisl ut diam suscipit, vitae scelerisque tellus posuere. Nam finibus, lacus quis efficitur cursus, neque purus molestie elit, eu interdum ipsum ex vel lacus. Nulla facilisi. Integer non orci quis dui pharetra venenatis dapibus sed neque. Vivamus laoreet, erat id tincidunt dignissim, arcu ipsum ultrices ante, et elementum metus felis ut urna. Nullam faucibus interdum ultricies. In nunc ex, dapibus non urna eu, venenatis iaculis metus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean ullamcorper varius enim, et cursus mi tempor et.</p>

		  <p>Cras lacus arcu, ultrices in massa eu, volutpat scelerisque nibh. Quisque porttitor neque odio, a venenatis risus auctor aliquam. Vivamus varius sem est, sit amet pulvinar sapien varius quis. Fusce nunc leo, efficitur at pharetra ac, molestie ac erat. Nunc pellentesque sollicitudin risus, non commodo purus facilisis vitae. Vivamus molestie nisi non libero sollicitudin, vel viverra nisi auctor. Aliquam hendrerit fermentum sapien, sit amet pretium odio aliquam quis. Cras porttitor sit amet sem a accumsan. Sed porta justo id nulla egestas iaculis.</p>

		  <p>Nulla finibus, libero ac porta tristique, metus nunc suscipit magna, ut eleifend nisl nunc at dolor. Morbi lobortis pellentesque massa vel placerat. Duis vel est elit. Etiam nec arcu ac elit fermentum pellentesque. Nulla laoreet vulputate sem in eleifend. Suspendisse fermentum nulla sed neque ultricies, ac congue massa lobortis. Maecenas sollicitudin nisl ut diam suscipit, vitae scelerisque tellus posuere. Nam finibus, lacus quis efficitur cursus, neque purus molestie elit, eu interdum ipsum ex vel lacus. Nulla facilisi. Integer non orci quis dui pharetra venenatis dapibus sed neque. Vivamus laoreet, erat id tincidunt dignissim, arcu ipsum ultrices ante, et elementum metus felis ut urna. Nullam faucibus interdum ultricies. In nunc ex, dapibus non urna eu, venenatis iaculis metus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean ullamcorper varius enim, et cursus mi tempor et.</p>
	  	</div>

	  	<div id="work">
		  <h2>Work</h2>

		  <div class="image">Image</div>
		  <div class="image i">Image</div>

		  <p>Morbi vitae tristique nisi, et condimentum lectus. Suspendisse sit amet nunc imperdiet, sagittis odio id, iaculis sapien. Quisque gravida semper sem, id commodo neque iaculis at. Nullam aliquet risus id nunc vehicula semper. Suspendisse mauris mi, dictum sed tempus quis, imperdiet eget justo. In dictum, est nec dapibus sagittis, mauris nisl laoreet mauris, nec tincidunt velit augue eget arcu. Praesent tempus ipsum eu neque rhoncus, vel luctus libero commodo. Ut vulputate nisi ac tortor facilisis, vitae blandit eros fringilla. Morbi sed augue semper, ultricies magna eu, eleifend enim. Duis maximus aliquet porttitor. Sed hendrerit at sem vitae placerat. Morbi tincidunt dolor in massa tempor, eget sollicitudin lectus dictum. Donec et leo mi. Ut volutpat facilisis consequat. Cras dictum non velit ut suscipit. Nulla egestas dictum quam, nec viverra nulla.</p>

		  <p>Curabitur bibendum, metus eu elementum bibendum, lorem libero auctor dolor, quis pellentesque justo lectus nec orci. In hac habitasse platea dictumst. Sed tristique maximus lacus, in lobortis velit maximus in. Quisque lobortis mi id urna sagittis eleifend. Curabitur ornare eros vitae massa efficitur, ut pharetra orci ultrices. Vestibulum fermentum ipsum eget nisl tempus tristique. Vestibulum id sapien eget diam vestibulum ultrices. Cras ut tempus nisl.</p>

		  <p>Fusce ut elit risus. Vestibulum ut cursus felis, quis interdum ex. Nulla magna massa, porttitor in arcu non, pharetra pulvinar leo. Sed accumsan purus eget interdum consequat. Etiam et auctor tellus, in posuere lacus. Nullam augue lectus, gravida eu gravida vitae, tristique sodales enim. Mauris scelerisque volutpat ex, a aliquet est molestie eu. Integer commodo dapibus efficitur. Donec egestas, mauris a sagittis pellentesque, est sapien eleifend eros, ut pellentesque turpis eros sit amet massa. Fusce mollis mi vel odio porttitor, et convallis leo blandit. Vivamus nec iaculis risus. Sed fringilla imperdiet iaculis. Vestibulum ut libero sapien. Aliquam erat volutpat. Quisque sodales urna tristique mattis fermentum. Phasellus rhoncus lacus nec porttitor finibus.</p>
	  	</div>

	  	<div id="info">
		  <h2>Other Info</h2>
		  <p>Integer pretium purus et lorem posuere, ut porttitor nisi posuere. Mauris consectetur massa ut tellus condimentum, non sagittis velit fringilla. Ut fermentum quam ac odio pharetra facilisis. Quisque facilisis quam massa, id finibus dolor ullamcorper et. Donec metus sem, tincidunt vel tellus in, viverra auctor nunc. Suspendisse potenti. Integer lobortis pharetra tristique. Duis in eleifend augue, id ullamcorper lectus. Aenean felis purus, tincidunt vitae porttitor non, vulputate non metus.</p>

		  <p>Morbi vitae tristique nisi, et condimentum lectus. Suspendisse sit amet nunc imperdiet, sagittis odio id, iaculis sapien. Quisque gravida semper sem, id commodo neque iaculis at. Nullam aliquet risus id nunc vehicula semper. Suspendisse mauris mi, dictum sed tempus quis, imperdiet eget justo. In dictum, est nec dapibus sagittis, mauris nisl laoreet mauris, nec tincidunt velit augue eget arcu. Praesent tempus ipsum eu neque rhoncus, vel luctus libero commodo. Ut vulputate nisi ac tortor facilisis, vitae blandit eros fringilla. Morbi sed augue semper, ultricies magna eu, eleifend enim. Duis maximus aliquet porttitor. Sed hendrerit at sem vitae placerat. Morbi tincidunt dolor in massa tempor, eget sollicitudin lectus dictum. Donec et leo mi. Ut volutpat facilisis consequat. Cras dictum non velit ut suscipit. Nulla egestas dictum quam, nec viverra nulla.</p>

		  <p>Nulla finibus, libero ac porta tristique, metus nunc suscipit magna, ut eleifend nisl nunc at dolor. Morbi lobortis pellentesque massa vel placerat. Duis vel est elit. Etiam nec arcu ac elit fermentum pellentesque. Nulla laoreet vulputate sem in eleifend. Suspendisse fermentum nulla sed neque ultricies, ac congue massa lobortis. Maecenas sollicitudin nisl ut diam suscipit, vitae scelerisque tellus posuere. Nam finibus, lacus quis efficitur cursus, neque purus molestie elit, eu interdum ipsum ex vel lacus. Nulla facilisi. Integer non orci quis dui pharetra venenatis dapibus sed neque. Vivamus laoreet, erat id tincidunt dignissim, arcu ipsum ultrices ante, et elementum metus felis ut urna. Nullam faucibus interdum ultricies. In nunc ex, dapibus non urna eu, venenatis iaculis metus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean ullamcorper varius enim, et cursus mi tempor et.</p>

		  <p>Curabitur non pellentesque eros. Donec a dictum massa. Cras gravida nisl metus, quis consequat mauris porttitor nec. Morbi malesuada nulla sed mi porttitor sollicitudin. Phasellus pellentesque lorem nisi. In varius fringilla risus, nec elementum metus feugiat ac. Suspendisse non nisi eget augue tincidunt ultrices. Fusce id dapibus ligula. Vivamus interdum in arcu id sollicitudin. Nulla vel turpis sapien. Aliquam id iaculis dui. Donec vitae volutpat massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In eget maximus velit. Aliquam vel tempus mauris. Duis ut pharetra nibh.</p>
	  	
		  <a href="#top" class="up"><i class="fa fa-chevron-up"></i></a>
		  <p class="copy">&copy; 2014</p>
	  	</div>
	</div>
	<script src="https://code.jquery.com/jquery-latest.min.js"></script>
	<script src="js/app.js"></script>
</body>
</html>

              
            
!

CSS

              
                /* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: local('Lato Regular'), local('Lato-Regular'), url(https://fonts.gstatic.com/s/lato/v11/8qcEw_nrk_5HEcCpYdJu8BTbgVql8nDJpwnrE27mub0.woff2) format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: local('Lato Regular'), local('Lato-Regular'), url(https://fonts.gstatic.com/s/lato/v11/MDadn8DQ_3oT6kvnUq_2r_esZW2xOQ-xsNqO47m55DA.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  src: local('Lato Bold'), local('Lato-Bold'), url(https://fonts.gstatic.com/s/lato/v11/rZPI2gHXi8zxUjnybc2ZQFKPGs1ZzpMvnHX-7fPOuAc.woff2) format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  src: local('Lato Bold'), local('Lato-Bold'), url(https://fonts.gstatic.com/s/lato/v11/MgNNr5y1C_tIEuLEmicLmwLUuEpTyoUstqEm5AMlJo4.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 900;
  src: local('Lato Black'), local('Lato-Black'), url(https://fonts.gstatic.com/s/lato/v11/t85RP2zhSdDjt5PhsT_SnlKPGs1ZzpMvnHX-7fPOuAc.woff2) format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 900;
  src: local('Lato Black'), local('Lato-Black'), url(https://fonts.gstatic.com/s/lato/v11/lEjOv129Q3iN1tuqWOeRBgLUuEpTyoUstqEm5AMlJo4.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}




/* ================================
 Global Styles
================================ */

@font-face {
  font-family: 'Zodiaclaw';
  src: url('../fonts/zodiaclaw.ttf');
  src: url('../fonts/zodiaclaw.ttf')  format('truetype');
}

*, *:before, *:after {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
body {
	margin: 0;
	font: 1em/1.5 "Lato";
	color: #444134;
}
html {background: #fff}
::selection {
	background: #ff512f;
	color: #fff;
}

header,
nav,
.image,
.up {
	text-align: center;
}

p {
	letter-spacing: .6px;
}


/* ================================
 Header
================================ */
header {
  height: 350px;
  padding-top: 50px;
  color: #f7f8ee;
  background: -webkit-radial-gradient(2.03% 90.07%, circle, #ff512f, transparent 100%), -webkit-radial-gradient(97.97% 10.95%, circle, #f09819, transparent 100%), -webkit-radial-gradient(50% 50%, circle, #c31c73, #c31c73 100%);
  background: -moz-radial-gradient(2.03% 90.07%, circle, #ff512f, rgba(255,0,0,0) 100%), -moz-radial-gradient(97.97% 10.95%, circle, #f09819, rgba(255,0,0,0) 100%), -moz-radial-gradient(50% 50%, circle, #c31c73, #c31c73 100%);
  background: -o-radial-gradient(2.03% 90.07%, circle, #ff512f, transparent 100%), -o-radial-gradient(97.97% 10.95%, circle, #f09819, transparent 100%), -o-radial-gradient(50% 50%, circle, #c31c73, #c31c73 100%);
  background: radial-gradient(circle at 2.03% 90.07%, #ff512f, rgba(255,0,0,0) 100%),radial-gradient(circle at 97.97% 10.95%, #f09819, rgba(255,0,0,0) 100%),radial-gradient(circle at 50% 50%, #c31c73, #c31c73 100%);
}
a[href="#wrapper"] {
	display: block;
	width: 30px;
	height: 50px;
	margin: 0 auto;
	outline: 0 none;
}
a:focus {
	outline: 0 none;
}
header p {
	margin: 5px;
}
.mouse {
	position: relative;
	border: 2px solid #fff;
	border-radius: 16px;
	height: 50px;
	width: 30px;
	margin: 85px auto 0;
	z-index: 3;
}

.mouse .wheel {
	position: relative;
	border-radius: 10px;
	background: #fff;
	width: 4px;
	height: 10px;
	top: 4px;
	margin-left: auto;
	margin-right: auto;
	-webkit-animation-name: drop;
	-webkit-animation-duration: 1s;
	-webkit-animation-timing-function: linear;
	-webkit-animation-delay: 0s;
	-webkit-animation-iteration-count: infinite;
	-webkit-animation-play-state: running;
	animation-name: drop;
	animation-duration: 1s;
	animation-timing-function: linear;
	animation-delay: 0s;
	animation-iteration-count: infinite;
	animation-play-state: running;
}

@-webkit-keyframes drop	{
	0%   { top:5px;  opacity: 0;}
	30%  { top:10px; opacity: 1;}
	100% { top:25px; opacity: 0;}
}

@keyframes drop	{
	0%   { top:5px;  opacity: 0;}
	30%  { top:10px; opacity: 1;}
	100% { top:25px; opacity: 0;}
}


/* ================================
 Navigation
================================ */
header,
nav {
  width: 100%;
}

nav {
	height: 100px;
	padding: 10px 25px;
	z-index: 2;
	margin-top: -100px;
	transition: .7s ease-out;
}

nav.fix {
	background-image: -webkit-linear-gradient(top, #1abc9c 60%, rgba(26,188,156,.85));
	background-image:    -moz-linear-gradient(top, #1abc9c 60%, rgba(26,188,156,.85));
	background-image:      -o-linear-gradient(top, #1abc9c 60%, rgba(26,188,156,.85));
	background-image:         linear-gradient(to bottom, #1abc9c 60%, rgba(26,188,156,.85));
	position: fixed;
	top: 100px;
	height: 80px;
	box-shadow: 0 3px 4px rgba(26,188,156,.2);
	z-index: 5;
}

.nav-logo,
.nav-items {
	display: inline-block;
	text-align: center;
}

.nav-items {
	width: 33.333%;
	position: relative;
	transition: .4s ease-in;
}
.nav-items.fix {
	top:-15px;
}
.nav-logo {
	opacity: 0;
	color: #fff;
	transform: translateY(-3599px);
	transition: .3s ease-out;
}
.nav-logo.fix {
	opacity: 1;
	transform: translateY(0);
	margin: -15px 0 0;
	font-size: 60px;
	font-weight: 300;
	letter-spacing: 0;
	font-family: "Zodiaclaw";
	cursor: pointer;
}
.nav-logo.fix:hover {
	color: #16a085;
}

.nav-items a {
	width: 30%;
	font-size: .9em; 
	text-decoration: none;
	font-weight: bold;
	line-height: 17px;
	text-transform: uppercase;
	color: #fff;
	display: inline-block;
	margin: 0 5px;
	border: 2px solid transparent;
	border-bottom: 1px solid #fff;
	padding: 15px;
	transition: .5s ease-in-out;
}
.nav-items a:hover {
	border: 2px solid #fff;
	background: #fff;
	color: #777;
    border-radius: 30px;
    transition: .4s;
}
.active {
	border: 2px solid #fff !important;
	border-radius: 30px !important;
}

/* ================================
 Wrapper
================================ */
.wrapper {
  background: #fff;
  padding: 60px 90px 50px;
  transition: .5s ease-out;
}

/* ==================
 Image div
================== */
.image {
	width: 49%;
	height: 300px;
	margin-bottom: 40px;
	color: #ecf0f1;
	font-size: 32px;
	line-height: 300px;
	letter-spacing: .8px;
	background: #bdc3c7;
	float: left;
}

.image.i {
	margin-left: 2%;
}

.wrapper p {
     margin-bottom: 25px;
}
.up {
	display: block;
	color: #fff;
	width: 50px;
	height: 50px;
	font-size: 18px;
	line-height: 46px;
	background: #1abc9c;
	border-radius: 50%;
	transition: .4s;
}

.up:hover {
	background: #fff;
	color: #1abc9c;
}

p.copy {
	color: #bbb;
	float: right;
}
              
            
!

JS

              
                var fix = "fix",
    hdr = $('header').height();

$(window).load(function() { // Doing it this way because of some bugs with the nav

  function down() {
    if( $(window).scrollTop() > hdr ) {
      $("nav").addClass(fix);
      $(".nav-logo").addClass(fix);
      $(".nav-items").addClass(fix);
    } else {
      $("nav").removeClass(fix);
      $(".nav-logo").removeClass(fix);
      $(".nav-items").removeClass(fix);
    }
  }

  function activateLink(event){
    var pos = $(document).scrollTop();
    var whiteSpace = 100;
    $('.nav-items a').each(function () {
        var link = $(this);
        var section = $(link.attr("href"));
        if (section.position().top <= pos + whiteSpace && section.position().top + section.height() > pos + whiteSpace) {
            $(".nav-items a").removeClass("active");
            link.addClass("active");
        }
        else{
            link.removeClass("active");
        }
    });
  };
  //Init down() and activateLink()
    down();
    activateLink();

  //Init down() on scroll
  $(window).on("scroll", function() {
    down();
    activateLink();
  });

});




/***************** Smooth Scrolling ******************/

$(function() {
  $('a[href*=#]:not([href=#])').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
      var target = $(this.hash);
      target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
      if (target.length) {
        $('html,body').animate({
          scrollTop: target.offset().top -85
        }, 1000);
        return false;
      }
    }
  });
});
              
            
!
999px

Console