<header>header</header>
<nav>nav</nav>
body{
  height: 300vh;
}
header{
  height: 80px;
  background: pink;
}
nav{
  padding: 10px;
  background: lightblue;
  position: sticky;
  top:0;
}

External CSS

  1. https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css

External JavaScript

This Pen doesn't use any external JavaScript resources.