<body>
    <header></header>  
</body>
body {
    background: #1a1a1a;
    height: 200vh;
    margin: 0;
}

header {
    background: #ff4163;
    height: 50px;
    position: sticky;
    top: 0px;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.