views:

964

answers:

3

How do I freeze the top section of a MasterPage so that the menu doesn't scroll off the screen?

+1  A: 

You can used the position:fixed css style, but this only works with modern browsers (FF3, IE7). If you want to support older browsers you have to get more creative, using Javascript and such.

Travis Collins
yeah we have old browsers here - ie6
+6  A: 

CSS Fixed Header Layout

Chris Doggett
+1  A: 

If you want to support more browsers, you can also look at the AlwaysVisibleControl which comes with the free ASP.NET Ajax Toolkit

Travis Collins
wow, that's really cool thanks.
I tried it and it's cool, but theres sort of a delayed effect where it catches up. I was hoping for something similar to the bar at the top of this page that tells me I have 1 new answer.
The delay is because in older browsers, it's using Javascript to handle the scroll event. You will not see the delay in newer browsers, so those users will have a slightly better experience. If you see a bar on this page, you could view source, or use firebug to find out how SO is doing it ;-)
Travis Collins