tags:

views:

31

answers:

1

Is there any valid way to show dummy scroll bar in firefox?

+2  A: 

If you just want scrollbars to test the look of having a bar, try setting the overflow property:

body { overflow:scroll; }

This will force Firefox to display a scrollbar for your window. For a vertical bar only, use overflow-y instead:

body { overflow-y:scroll; }

This is the best way to force scroll bars.

Joseph Mastey
i want to keep dummy scrollbar forever in firefox. even if content is shorter than available height
metal-gear-solid
The above style will display a scrollbar all the time, even if the content is shorter than the available height. If you had wanted only to set optional scrollbars (the default behavior) you would set overflow to "auto" instead. "scroll" forces a scrollbar to display.
Joseph Mastey
@metal-gear-solid The second example will achieve just that.
alex
@alex - but this is not valid css
metal-gear-solid
@metal - Sure it is, and supported for a long time, just now becoming part of the spec: http://www.css3.com/css-overflow-y/
Nick Craver
@Nick Craver - +1 Oh yes you are right it's valid with css3 option in Validator
metal-gear-solid
@Joseph Mastey - yes i will go for `html { overflow-y:scroll; }` Thanks
metal-gear-solid