Addendum to Alex Wayne's answer:
I found it necessary to add a z-index with a sufficiently large number so that the navigation bar is always displayed on top of other elements.
#navbar { z-index: 10000; position: fixed; top: 0px; width: 100%; }β
source share