Issue with fix nav


I’m having issue with my fixed navigation, the navigation is working fine however I have a “topbar” section which I would like displayed, however once I make the navigation fixed it gets rid of the topbar?

Hope you can help.

Protip: Give your body the same padding-top as your fixed header’s height.

hmm sorry @samliew I don’t quite understand what you mean? I added top padding to my body but it didn’t make any real difference? It brought the topnav below the actual nav?

You want the top bar to be above the fixed nav bar? Then you need to wrap the top bar and nav bar in another div, let’s call it header, then fix the header instead of the nav bar.

When I do that, the header whole nav just disappears when I make it fixed. Then it shows when I scroll down but not how it should.

You also need to style your new fixed header, like how you did it for the previous fixed header. Give it a width of 100% and z-index of 9999. After that, you can follow the same advice as my first post above.

1 Like

Worked a treat, thank you :slight_smile:

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.