How do I make the nav bar always at the top?

Shamoon picture Shamoon · Nov 14, 2012 · Viewed 44k times · Source

I'm using Foundation by ZURB and trying to get the nav bar to the top.

Answer

Alex Wayne picture Alex Wayne · Nov 14, 2012

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/