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
2010-05-31 01:17:47
i want to keep dummy scrollbar forever in firefox. even if content is shorter than available height
metal-gear-solid
2010-05-31 01:18:40
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
2010-05-31 01:20:10
@metal-gear-solid The second example will achieve just that.
alex
2010-05-31 01:20:44
@alex - but this is not valid css
metal-gear-solid
2010-05-31 01:22:56
@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
2010-05-31 01:25:43
@Nick Craver - +1 Oh yes you are right it's valid with css3 option in Validator
metal-gear-solid
2010-05-31 01:28:41
@Joseph Mastey - yes i will go for `html { overflow-y:scroll; }` Thanks
metal-gear-solid
2010-05-31 01:32:11