html - 如何防止 IE10 中的滚动条覆盖内容?

标签 html css scrollbar internet-explorer-11 internet-explorer-10

在 IE10 中,滚动条并不总是存在......当它出现时它作为覆盖层出现......这是一个很酷的功能但我想为我的特定网站关闭它,因为它是全屏应用程序以及我的 Logo 和菜单都丢失了。

IE10:

enter image description here

Chrome :

enter image description here

有人知道在 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/

相关文章:

javascript - 将页面粘贴到左下角而不是默认的左上角?

javascript - 用图像填充数百个 SVG 路径会导致严重的性能问题

javascript - 如何使用 Javascript 将 li 更改为点击时激活?

html - flexbox 中的 align-self 属性不起作用?

jquery - 在 html 加载默认浏览器滚动条之前加载 NiceScroll

html - 需要帮助对齐 HTML 和 CSS 中的图像

javascript - 同时弹出并更改位置

html - 文本叠加隐藏在旁边的图像后面

c# - 如何在 C# 中查找滚动查看器的垂直滚动条宽度

winforms - 自定义绘制Windows窗体滚动条?