I'm using Foundation
by ZURB
and trying to get the nav bar to the top.
To create a fixed top menu, use position:fixed and top:0 . Note that the fixed menu will overlay your other content. To fix this, add a margin-top (to the content) that is equal or larger than the height of your menu.
Just put your code in div with class of container . Set top and bottom margin to body and that is it.
Many web designers consider the navigation bar to be part of the header rather than a individual component, but that's not a requirement; in fact some also argue that having the two separate is better for accessibility, as screen readers can read the two features better if they are separate.
I have no idea what those 2 things are, but this is how you fix something in place regardless of window scroll position with CSS:
#navbar {
position: fixed;
top: 0px;
width: 100%;
}
See here: http://jsfiddle.net/qC2Dt/
If you're using foundations, you can use:
<nav class="top-bar fixed"></nav>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With