header { position: sticky; top: 0; z-index: 1000; /* Ensures it stays layered on top of other content */ background-color: #ffffff; /* Must be solid, otherwise scrolled content will bleed through */ }