shadowz shadowz - 3 years ago 173
HTML Question

How would I keep a fixed nav on top at all times in HTML/CSS?

Well I am working on creating my own personal website, it is a one page scrollable website with a fixed navigation at the top. I added a JQuery light box gallery from code I found online, it works fine, the only problem is when I am scrolling past the gallery, the tiles scroll up over my fixed navigation. Is there a way I can make it so my nav is always on top? Or do I have to edit the actual gallery plugin itself.

Answer Source

The z-index CSS property controls how elements overlap with each other. If you set your navbar's z-index to a higher value than that of the gallery, it will appear on top.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download