I\'m trying to do a bootstrap menu with an image and under the menu links, that when it\'s scrolled the menu sticks on the top of the window.
I\'ve found interesting
It seems this can be achieved by replacing the CSS you provided by
#nav {
width: 100%;
position:fixed;
}
#nav.affix {
top: 0;
}
#nav > .navbar-inner {
border-left: 0;
border-right: 0;
border-radius: 0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
-o-border-radius: 0;
}
The main difference is that here, #nav
covers both the cases #nav.affix
and #nav.affix-top
See this jsfiddle.
edit:
The problem turns out to occur when #nav
's position is inherited. If you fix it, as I suggested, or if you set it to relative, as the other post suggested, your problem will be solved.