在 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.
关于html - 如何防止 IE10 中的滚动条覆盖内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32318788/