<body>
  <nav>
    <ul>
      <li><a href="#first">First</a></li>
      <li><a href="#second">Second</a></li>
      <li><a href="#third">Third</a></li>
    </ul>
  </nav>
  <section id="first">First Section</section>
  <section id="second">Second Section</section>
  <section id="third">Third Section</section>
</body>
html {margin: 0; padding: 0; scroll-behavior: smooth;}
body {
  min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  
  nav {
    position: sticky;
    top: 0;
    
    ul {
      width: 100%;
      display: flex;
      justify-content: flex-end;
      box-sizing: border-box;
      padding: 20px;
      background: #fff;
      
      li {
        list-style: none;
        margin-right: 20px;
        font-size: 25px;
        font-weight: bold;
        
        a {
          text-decoration: none;
          color: #1ac;
        }
      }
    }
  }
  
  section {
    height: 100vh;
    display: grid;
    place-items: center;
    font-size: 50px;
    font-weight: bold;
    background: #eee;
  }
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.