🌐Sticky Header
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
Example code
css
header { position: sticky; top: 0; }Common mistake
Key takeaways
- 1Stays at the top. Page scrolls under it.
- 2Keep it short. It costs space.
- 3Hide on scroll down. Return on scroll up.