How does facebook manage to have all the content of the page scrollable except the top nav bar and chat?
| SitePoint Sponsor |
How does facebook manage to have all the content of the page scrollable except the top nav bar and chat?


Basically with position: fixed:
Code:#blueBar.fixed_elem { left: 0; top: 0; } #blueBar { background-color: #3B5998; min-width: 981px; width: 100%; z-index: 300; } .fixed_elem { position: fixed !important; }
Soo this means the any element with this will just stay on the browser window even if your scrolling down?


Yes, that's the point of position: fixed. It doesn't work in some browsers, though, like IE6 and iPhone.
Thanks!!
Bookmarks