Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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="site-header"></header>
<nav class="site-nav">

			<div class="wrapper">

				<ul>
					<li><a class="active" href="#" tabindex="2">Link 1</a></li>
					<li><a href="#" tabindex="3">Link 2</a></li>
					<li><a href="#" tabindex="4">Link 3</a></li>
					<li><a href="#" tabindex="5">Link 4</a></li>
					<li class="search-trigger-container"><a href="#" id="search-trigger" class="search-trigger" tabindex="5">Search</a></li>
        </ul>

			</div>

</nav>
<div class="content wrapper">
  <!-- start slipsum code -->

<h1>Are you ready for the truth?</h1>
<p>The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. </p>

<h1>Is she dead, yes or no?</h1>
<p>You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man. </p>

<h1>I took lessons</h1>
<p>Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass. </p>

<h1>We happy?</h1>
<p>Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass. </p>

<h1>Are you ready for the truth?</h1>
<p>Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price. </p>

<!-- please do not remove this line -->

<div style="display:none;">
<a href="http://slipsum.com">lorem ipsum</a></div>

<!-- end slipsum code -->

</div>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Merriweather:700,900);
@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,400,600,700,900);

h1, p { margin-bottom: 1.25em; max-width: 700px; }
h1 { font-family: Merriweather; font-weight: 900; }
p { font-size: 0.8rem; line-height: 1.75em; }

html {
        background: #000;
        font-size: 140%;
        line-height: 1.7em;
}

body {
        background-color: #eee;
        color: #444;
        font-family: 'Source Sans Pro';
        font-size: inherit;
        font-weight: 400;
        min-height: 1000px;
        padding: 100px 0 0;
        transition: background-color 350ms ease-in-out;
}

body.sticky { background-color: #eee; }

.wrapper {
        background: #fafafa;
        margin: auto;
        padding: 0 30px;
        max-width: 1140px;
}

.site-nav {
        background: transparent;
        box-shadow: 0 5px 5px -2px rgba(0, 0, 0, 0),0px 1px 8px 0px rgba(0, 0, 0, 0);
        min-height: 80px;
        transition: background-color 220ms ease-in, box-shadow 80ms ease-in;
}

.site-nav .wrapper { background: #fafafa; height: 40px; padding: 20px 30px; transition: background-color 100ms ease-in-out; }

nav ul { display: block; float: left; list-style: none; margin: 0; padding: 0; width: 100%; }

.site-nav li { display: block; float: left; height: 100%; line-height: 100%; margin: 0 20px 10px 0; }

.site-nav a {
        border-bottom: 5px solid transparent;
        color: #666;
        display: block;
        font-family: 'Source Sans Pro';
        font-weight: 200;
        font-size: 1.05rem;
        height: 43px;
        line-height: 45px;
        padding: 0 2px;
        text-align: center;
        text-decoration: none;
        text-transform: uppercase;
        transition: all 200ms ease-out;
        outline-width: 0;
}

.sticky .site-nav a {
  color: #888;
}

.site-nav a:focus,
.site-nav a:hover,
.site-nav a.active:focus,
.site-nav a.active:hover,
.site-nav .wrapper:hover a.active:focus,
.site-nav .wrapper:hover a.active:hover,
.pages a:focus,
.pages a:hover,
.pages a.current:focus,
.pages a.current:hover {
        border-color: #CF0404;
        border-width: 2px;
        color: #444;
        position: relative;
        top: -1px;
}

.site-nav .wrapper:hover a {
        color: transparent;
        text-shadow: 0 0 4px rgba(0,0,0,.5);
}

.site-nav .wrapper:hover a:focus,
.site-nav .wrapper:hover a:hover,
.site-nav .wrapper:hover a.active,
.site-nav .wrapper:hover a.active:focus,
.site-nav .wrapper:hover a.active:hover {
        color: #333;
        text-shadow: none;
}

.site-nav .wrapper:hover a.active {
        color: transparent;
        text-shadow: 0 0 4px rgba(0,0,0,.5);
}

.site-nav a.active,
.pages a.current {
        border-color: #333 ;
        border-width: 2px;
        color: #444; 
        font-weight: 400;
}

.site-nav a:active,
.site-nav a.active:active,
.pages a:active,
.pages a.current:active {
        border-color: #CF0404;
        border-width: 4px;
        top: 1px;
}

.sticky .site-header { margin-bottom: 80px; }

.sticky .site-nav {
	background: rgba(255,255,255,.8);
  box-shadow: 0 5px 5px -2px rgba(0, 0, 0, 0.1),0px 1px 8px 0px rgba(0, 0, 0, .6);
	margin: -180px 0 0;
	position:fixed;
	width:100%;
	z-index: 1000;
}

.sticky .site-nav .wrapper {
	background: rgba(250, 250, 250, 0.75);
}

.site-nav li.search-trigger-container {
  float: right;
}

#search-trigger {
  background-color: transparent;
  border: none;
  border-radius: 50%;
  box-shadow: none;
  display: block;
  height: 44px;
  margin: 0;
  padding: 0;
  position: relative;
  text-indent: -9999em;
  top: -2px;
  transition: background-color 250ms ease-out, box-shadow 200ms ease-out, transform 200ms linear;
  width: 44px;
}

#search-trigger:before {
  background-color: inherit;
  border: 3px solid #333;
  border-radius: 50%;
  content: ' ';
  display: block;
  height: 16px;
  position: absolute;
  right: 8px;
  top: 8px;
  transition: border-color 200ms ease-out;
  width: 16px;
}

#search-trigger:after {
  background: #333;
  border-radius: 2px;
  bottom: 14px;
  content: ' ';
  display: block;
  height: 3px;
  left: 8px;
  position: absolute;
  transform: rotate(-45deg);
  transition: background 200ms ease-out;
  width: 12px;
}

#search-trigger:focus,
#search-trigger:hover {
  background-color: #404040;
  transform: scale(1);
}

#search-trigger:hover:before {
  border-color: #fff;
}

#search-trigger:hover:after {
  background-color: #fff;
}

#search-trigger:active {
  box-shadow: 0 0 2px -2px rgba(0,0,0,.3);
  transform: scale(.9);
}

.content {
          min-height: 1140px;
          padding-top: 30px;
}
              
            
!

JS

              
                $(function() {
  $(document).bind('ready scroll', function() {
	   	var docScroll = $(document).scrollTop();
		  if (docScroll >= 100 & $('html').height() > 768) {
			  if (!$('body').hasClass('sticky')) {
				  $('body').addClass('sticky');
  			}
	  	} else {
		  	$('body').removeClass('sticky');
		  	$('.site-nav').removeAttr('style');
	  	}
    });
  
  $('.site-nav a').click(function(e){
    if(!$(this).hasClass('search-trigger'))
    {
      $('.site-nav a.active').removeClass('active');
      $(this).addClass('active');
    }
    $(this).blur()
    e.preventDefault();
  });
});
              
            
!
999px

Console