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

              
                <div class="header">
  <h1 class="logo">LOGO</h1>
</div>
 <div class="content">
	<div class="fixed_nav">
   <div class="navi_wrapper">
          <ul class="clearfix">
            <li><a class="third after" href="index.html">HOME</a></li>
            <li><a class="third after" href="index.html">ABOUT</a></li>
            <li><a class="third after" href="index.html">NEWS</a></li>
            <li><a class="third after" href="index.html">ACCESS</a></li>
          </ul>
    </div>
	 </div>
</div>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Cardo);
  @import url(https://fonts.googleapis.com/css?family=Questrial);


    *, *:after, *:before {
		-webkit-box-sizing:
		border-box;
		-moz-box-sizing:
		border-box;
		box-sizing:
		border-box;
		
	}
	body, html { 
		font-size: 100%;
	    padding: 0;
	    margin: 0;
	    font-family: 'Cardo', serif;
	}
	.fixed {
	    position: fixed;
	    top: 0;
	    left: 0;
	    width: 100%;
	}
	.content{
		height: 1500px;
		width: 100%;
        padding: 0;
	    margin: 0;
	}
  .header{
    	width: 100%;
    	height: 120px;
      text-align: center;
      background: #fff;
  }
  .logo{
      font-family: 'Questrial', sans-serif;
      font-size: 40px;
      margin: 0;
      padding:  35px 0 0 0;
  }


.fixed_nav{
   width: 100%;
   height: 50px;
   background: #060919;
   margin: 0;
   padding: 0;
    }

.fixed_nav .navi_wrapper{
  width: 1200px;
  margin: 0 auto;
  padding: 0;
}
.fixed_nav .navi_wrapper ul{
  margin: 0;
  padding: 0;
 
}
.fixed_nav .navi_wrapper ul li{
  list-style: none;
  float: left;
  margin: 15px 0 0 0;
  padding: 0;
  display: block;
  width: 25%;
  text-align: center;
  border-right: 1px dotted #fff;
    
}
.fixed_nav .navi_wrapper ul li:first-child{
      border-left: 1px dotted #fff;
}
.fixed_nav .navi_wrapper ul li a{
  padding: 10px 30px;
  margin: 20px 0 0 0;
  color: #fff;
  text-decoration: none;
  letter-spacing: 1px;
    
    
}
.navi_wrapper ul li a:hover{
  color: #777;
    

}
.navi_wrapper ul li a,.navi_wrapper ul li a:visited,.navi_wrapper ul li a:hover,.navi_wrapper ul li a:active{
  -webkit-backface-visibility:hidden;
          backface-visibility:hidden;
    position:relative;
  transition:0.5s color ease;
    text-decoration:none;
    color:#fff;
    font-size:14px;
}
.navi_wrapper ul li a:hover{
    color:#777;
}
.navi_wrapper ul li a.before:before,.navi_wrapper ul li a.after:after{
  content: "";
  transition:0.5s all ease;
  -webkit-backface-visibility:hidden;
          backface-visibility:hidden;
  position:absolute;
}
.navi_wrapper ul li a.before:before{
  top:3px;
}
.navi_wrapper ul li a.after:after{
  bottom:3px;
}
.navi_wrapper ul li a.before:before,.navi_wrapper ul li a.after:after{
  height:1px;
  height:1px;
  width:0;
  background:#fff;
}

.navi_wrapper ul li a.third:after,.navi_wrapper ul li a.sixth:before,.navi_wrapper ul li a.sixth:after{
  left:50%;
  -webkit-transform:translateX(-50%);
          transform:translateX(-50%);
}
.navi_wrapper ul li a.before:hover:before,.navi_wrapper ul li a.after:hover:after{
  width:100%;

}


@media screen and (max-width:768px) {
      .fixed_nav .navi_wrapper{
        width: 100%;
        margin: 0 auto;
       }
      .fixed_nav .navi_wrapper ul li a{
      	padding: 0;
      	margin: 0;
      	color: #fff;
      	text-decoration: none;
      	letter-spacing: 1px;
      }
      .fixed_nav .navi_wrapper ul li:first-child{
      	border-left: none;
      }
      .fixed_nav .navi_wrapper ul li:last-child{
      	border-right: none;
       }
       .navi_wrapper ul li a.before:before{
      top:-5px;
      }
      .navi_wrapper ul li a.after:after{
        bottom:-5px;
      }  
}
@media screen and (max-width:480px) {
	.fixed_nav .navi_wrapper{
      width: 100%;
      margin: 0 auto;
     }
	.fixed_nav .navi_wrapper ul li a{
	    	padding: 0;
	    	margin: 0;
	    	color: #fff;
	    	text-decoration: none;
	    	letter-spacing: 1px;
	    }
	.fixed_nav .navi_wrapper ul li:first-child{
	    	border-left: none;
	    }
	 .fixed_nav .navi_wrapper ul li:last-child{
	    	border-right: none;
	    }
    .navi_wrapper ul li a.before:before{
      top:-5px;
      }
      .navi_wrapper ul li a.after:after{
        bottom:-5px;
      }     
}
              
            
!

JS

              
                $(function() {
      var nav = $('.fixed_nav');
      //表示位置
      var navTop = nav.offset().top+100;
      //ナビゲーションの高さ(シャドウの分だけ足してます)出るタイミング
      var navHeight = nav.height()+10;
      var showFlag = false;
      nav.css('top', -navHeight+'px');
      //ナビゲーションの位置まできたら表示
      $(window).scroll(function () {
          var winTop = $(this).scrollTop();
          if (winTop >= navTop) {
              if (showFlag == false) {
                  showFlag = true;
                  nav
                      .addClass('fixed')
                      .stop().animate({'top' : '0px'}, 500);
                      //表示速度
              }
          } else if (winTop <= navTop) {
              if (showFlag) {
                  showFlag = false;
                  nav.stop().animate({'top' : -navHeight+'px'}, 500, function(){
                      nav.removeClass('fixed');
                  });
              }
          }
      });
  });

  $(function(){
      var headerHight = 50; //ヘッダの高さ
     // #で始まるアンカーをクリックした場合に処理
     $('a[href^=#]').click(function() {
        // スクロールの速度
        var speed = 400; // ミリ秒
        // アンカーの値取得
        var href= $(this).attr("href");
        // 移動先を取得
        var target = $(href == "#" || href == "" ? 'html' : href);
        // 移動先を数値で取得
        var position = target.offset().top-headerHight;
        // スムーススクロール
        $('body,html').animate({scrollTop:position}, speed, 'swing');
        return false;
     });
  });
              
            
!
999px

Console