-moz-scrollbars - the vertical equivalent for Chrome / Opera / Safari?

IE6, IE7, and IE8 display the vertical scroll bar for the default page, even if it does not scroll. Chrome and Firefox do not (I assume Opera and Safari are wrong). You can do the same behavior in FireFox using CSS:

body { overflow: -moz-scrollbars-vertical; } 

Is there a way to force the visible scrollbar in the other three browsers? Or even better, a standard way to do this?

+4
source share
2 answers

Update

You can (in addition) include -ms-overflow-y and / or -moz-scrollbars-vertical , as stated in fooobar.com/questions/462414 / ... :

 html { overflow: -moz-scrollbars-vertical; /* For FF */ -ms-overflow-y: scroll; /* For IE */ overflow-y: scroll; /* For others & old IE */ } 

Original

 html { overflow-y: scroll; } 

See "overflow-y" at W3Schools

Tested and verified (successfully) in:

  • Ff 7
  • Chrome 15
  • IE 5 + 6 + 7 + 8 + 9 + 10 (platform preview) w / IETester
  • Opera 11.52
  • Safari / Win 5.1.1

Full example

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style type="text/css"> html { overflow-y: scroll; } </style> </head> <body> Test content </body> </html> 
+6
source
 html { height: 100%; margin-bottom: 1px; } 

See for more information on scrolling (now even better) .

+3
source

All Articles