til

Lock An Element To The Browser Window With Fixed Positioning

The next layout scheme that CSS offers is the fixed position, which is a type of absolute positioning that locks an element relative to the browser window.

#navbar {
    position: fixed;
    top: 0px;
    left: 0px;
}

source