Skip to content
BENIBIX Learn

Sticky Header

Design🌐 Web DesignPage Anatomy

Also known as Fixed Header, Sticky Navigation, Persistent Header

A top strip that stays put. The page scrolls under it.

Think of it like

It is like a note stuck to the top of your screen. However far you scroll, it stays.

Example

Leo scrolls deep into a long article. The header with Search stays at the top, so he never has to scroll back up.

Why it matters

Long pages stay easy to leave and search from, without a long scroll back up.

Definition

A sticky header stays fixed at the top of the screen while the rest of the page scrolls under it. It keeps the menu and search one tap away on long pages. It should be short, because it takes screen space on every scroll. Some sticky headers hide when you scroll down and come back when you scroll up.

Example code

css
header { position: sticky; top: 0; }
sticky keeps the header pinned at the top once it reaches it.

Common mistake

A tall sticky header on a phone. It eats a big slice of a small screen.

Key takeaways

  1. 1
    Stays at the top. Page scrolls under it.
  2. 2
    Keep it short. It costs space.
  3. 3
    Hide on scroll down. Return on scroll up.