/* #navbar is the topmost element and <main> contains all other content */ #navbar { /* CSS property ensuring #navbar always stays in the same place even if the page is scrolled: */ position: fixed; } main { /* Ensure the remaining content doesn't hide behind the #navbar: */ position: absolute; z-index: 1; top: 100px; }