在 IE10 中,滚动条并不总是存在...当它出现时,它会以覆盖的形式出现...这是一个很酷的功能,但我想为我的特定网站关闭它,因为它是全屏的应用程序和我的 Logo 和菜单在它后面丢失了。
IE10:
Chrome :
有人知道在 IE10 上始终将滚动条固定在适当位置的方法吗?
overflow-y:scroll 似乎不起作用!它只是将它永久地放在我的网站上。
可能是 Bootstrap 导致了问题,但我不知道是哪一部分!参见此处的示例:http://twitter.github.io/bootstrap/
最佳答案
正如 xec 在他的回答中提到的,这种行为是由 @-ms-viewport 设置引起的。
好消息是,您不必删除此设置即可恢复滚动条(在我们的示例中,我们依赖 @-ms-viewport 设置来进行响应式网页设计)。
您可以使用 -ms-overflow-style 来定义溢出行为,如本文所述:
http://msdn.microsoft.com/en-us/library/ie/hh771902(v=vs.85).aspx
将样式设置为滚动条以获取滚动条:
body {
-ms-overflow-style: scrollbar;
}
scrollbar
Indicates the element displays a classic scrollbar-type control when its content overflows. Unlike -ms-autohiding-scrollbar, scrollbars on elements with the -ms-overflow-style property set to scrollbar always appear on the screen and do not fade out when the element is inactive. Scrollbars do not overlay content, and therefore take up extra layout space along the edges of the element where they appear.
https://stackoverflow.com/questions/17045132/