No this is not about using position: fixed by default. Take a look at this page as example, scroll down, and see the top-left. Notice the issue metadata stick on top? As far as I know there is no pure CSS for this task, it uses onscroll to do the job. The following element would stick on top after you scroll down enough:

Source Code

This will stay at top of page

I didn't invent this, the original code is from an answer1 on Stackoverflow, and that seems to be from Stackoverflow's code, but with a few of my own modifications. The code requires jQuery. The #sticky-anchor is for providing an offset reference, so we can compare with and know if visitor scrolls down far enough. If so, the #sticky would be applied with an CSS class, which makes it sticky to the page; if not, then remove the CSS class, so it can revert to what it should be when the page just loaded. This way make the code more cleaner. z-index is better to be applied since other elements may have that, make sure the number is high enough so #sticky would be on top of others.