August 13, 201412 yr Hello all, I'm a server side develolper with some experience in client side development. I can make my nav bar stick to the top of the page without any problem using the position fixed style. However when I insert a header tag above the nav tag the nav tag stays fixed but it drops down the page by the height of the 'header' tag. I've tried fixing both tags to the top of the page, (positioned underneath each other), but whenever I test my code the nav bar stays fixed but th header tag does not. To make things worse the 'nav' tag drops down the page leaving a gap the same size as the height of the 'header' tag. I'll give you an example: <body> <div id='header'>Header information goes here</div> <div id='wrapper'> <div class='navbar'></div> rest of body here........ ....................... </div> </body> As you can see the 'header' tag is divided from the 'nav' tag by the 'wrapper' tag. Does any one know how I can fix both 'header' and 'nav' tags to the top of the screen underneath each other so that when the user scrolls down the page both tags remain fixed to the top directly underneath each other whilst being divided by the 'wrapper' tag? Thanks in advance.
Create an account or sign in to comment