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


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


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.


                <link href=", 300,700" rel="stylesheet">

<nav id="nav">
  <h1>Still, breathing</h1>
    <li><a href="#section1">★</a></li>
    <li><a href="#section2">☆</a></li>
    <li><a href="#section3">★</a></li>
    <li><a href="#section4">☆</a></li>
    <li><a href="#section5">★</a></li>
    <li><a href="#section6">☆</a></li>

<div id="contents">
  <div id="section1">I'm like a child looking off in the horizon</div>
  <div id="section2">I'm like an ambulance that's turning on the sirens</div>
  <div id="section3">Oh, I'm still alive</div>
  <div id="section4">I'm like a soldier coming home for the first time</div>
  <div id="section5">I dodged a bullet and I walked across a landmine</div>
  <div id="section6">Oh, I'm still alive


                #nav {overflow: hidden; position: fixed; left: 0;top: 0; width: 100%; background-color:rgba(255, 255, 255, 0.5)}
#nav h1 { color:white; font-size: 40px; padding: 14px 5px 16px 20px; float: left;}
#nav ul {float: right;}
#nav ul li {display:inline;}
#nav ul li a {padding: 30px; text-decoration:none; color:white; display:inline-block;}

#contents {text-align:center; font-size: 40px; color:white; font-family: 'Saira', sans-serif; font-weight:100;}
#contents>div {height:100vh; line-height:100vh;}
#section1{background-color: #D7AEB2;}
#section2{background-color: #DF6071;}
#section3{background-color: #CC4337;}
#section4{background-color: #7E6146;}
#section5{background-color: #E78979;}
#section6{background-color: #8B6C71;}



                var nav =$("#nav ul li");
var contents =$("#contents>div"){
    var target= $(this); // 6개의 버튼 타켓을 변수 target에 할당
    var index=target.index();  //6개의 버튼에 인덱스의 변수를 만듬
   // alert(index);
    var section= contents.eq(index); //section에 contents의 인덱스를 할당
    var offset=section.offset().top; //6개의 컨텐츠의 offset 값을 할당
  // alert(offset);
   $("html, body").animate({scrollTop:offset},400);