Sticky header

Try to scroll the main content to see the header sticks to the top of page.
<div>
<header class="header">
...
</header>
<main>
...
</main>
</div>
.header {
/* Stick to the top */
position: sticky;
top: 0;
}

See also

Sticky sections

Sticky table column

Sticky table headers