CSS position:fixed for nested "nav" element

HTML

<div id="wrapper">
    <div id="navbar">This nav bar is nested within the wrapper.</div>
</div>

CSS

#wrapper {
    margin: 70px auto 0 auto;
    width: 300px;
    height: 900px;
    position:relative;
    background: #CCC;
}

#navbar {
    position: fixed;
    width: auto;
    height: 30px;
    /* top: 0; If you leave "top" undefined, it will maintain its default top position. If you remove the above "left: 0;", the nav won't stretch to the left edge anymore. I didn't test this cross-browser, but hope it helps! :) */
    background: #333;
    color: #FFF;
    text-align:center;
}