How to create sticky header bar for a website

Arsh Kapoor picture Arsh Kapoor · Nov 3, 2012 · Viewed 53.6k times · Source

I want to create a sticky header bar for a website just like the sticky header on this website (http://www.fizzysoftware.com/) if any on can can help me out with coding or any resource that helps me to create the same. Your reply would be of great help to me.

Answer

MichalHlavacek picture MichalHlavacek · Nov 3, 2012

In your CSS, add

position: fixed;

to your header element. It's just that simple, really. And next time, try to use right click on something you see on website and choose "Inspect element". I think that every modern browser has it now. Very useful function.