Reputation: 3581
I have this sample HTML5 page which have a navigation and a content area pasted on JSFiddle.
The problem is that <div id="nav">
isn't fixed when I scroll vertically. How can I make the navigation to be fixed on the top of the browser even with scrolled vertically?
Upvotes: 0
Views: 52
Reputation: 80
Create another hidden navigation (same with already used nav), and show it when user scrolls down enough.
Here is a good tutorial to do that.
And here is some edited and working example from my website.
Upvotes: 0
Reputation: 385
body {
margin: 0px;
width: 100%;
height: 120%;
background: red;
}
#nav {
position: fixed;
width: 100%;
z-index: 99;
height: 25px;
background: blue;
}
Upvotes: 1