Natasha Kydd
Natasha Kydd

Reputation: 35

How to stop second navbar from overlapping fixed navbar at the top of the page

I'm creating a webpage that has two navbars, one that is fixed and moves with the page when I scroll, and contains links to other pages, and the second navbar is for linking to certain sections of text on the same page.

The second navbar is causing me a lot of problems, mainly because it keeps overlapping the fixed navbar and site header.

I want the second navbar to move up when I scroll down, but go underneath the fixed navbar and headers.

Any help would be great, I know its probably a really small thing but its driving me crazy.

Upvotes: 2

Views: 104

Answers (1)

Eric Wiener
Eric Wiener

Reputation: 5947

I'm not 100% sure on what you're asking here, but from what I understand you could solve this by giving the second navbar a z-index of 1 and the first navbar and other headers the z-index of 2 (any values would work, as long as the first navbar has a smaller z-index than the others).

Upvotes: 1

Related Questions