My site is made up of four div
s; in order they are: header
, navbar
, main
, and footer
.
I want the header to stay in place and the navbar to be underneath the header when at the top, but when the page is scrolled I want just the navbar to stick to the top.
What happens with the code I have right now (http://jsfiddle.net/BGLwM/) is that the navbar sticks to the top, but on top of the header. When I set the top to be the height of the header (placing the navbar below the header) and scroll down, there is a gap as wide as the header and the navbar does not stick to the top.
Is there a way to solve this in pure CSS? I am NOT using Bootsrap and while I don't have a problem using JS or JQuery, I don't have any experience in using either.