-moz-scrollbars-vertical 相当于 Chrome/Opera/Safari?
IE6、IE7 和 IE8 默认情况下显示页面的垂直滚动条,即使它不可滚动。 Chrome 和 Firefox 不会这样做(我假设 Opera 和 Safari 也不会这样做)。您可以使用 CSS 在 FireFox 中完成相同的行为:
body { overflow: -moz-scrollbars-vertical; }
有没有办法在其他三个浏览器中强制显示滚动条?或者更好的是,有一个标准的方法?
IE6, IE7, and IE8 display a vertical scroll bar for the page by default even if it is not scrollable. Chrome and Firefox do not do this (I'm assuming Opera and Safari do not as well). You can accomplish this same behavior in FireFox using the CSS:
body { overflow: -moz-scrollbars-vertical; }
Is there any way to force the visible scrollbar in the other three browsers? Or even better, a standard way of doing it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
更新
您可能(此外)需要包含
-ms-overflow-y
和/或-moz-scrollbars-vertical
,如 此其他 StackOverflow 帖子:原文
参见 W3Schools 的“overflow-y”
已测试已在以下位置验证(成功):
完整示例
Update
You may (in addition) need to include
-ms-overflow-y
and/or-moz-scrollbars-vertical
, as mentioned in this other StackOverflow post:Original
See "overflow-y" at W3Schools
Tested & verified (successfully) in:
Full example
有关更多信息,请参阅强制滚动条(现在更好)信息。
See Forcing scrollbars (now even better) for more information.