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

在 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/

相关文章:

html - 标签中是否需要 ="text/css"类型?

html - 在 HTML 中呈现字符串并保留空格和换行符

html - 在 Notepad++ 中格式化代码

javascript - 从 onclick/onchange 事件中获取 HTML Checkbo

javascript - 如何使用 JavaScript 获取 HTML 页面的标题?

html - XHTML 中所有有效的自闭合元素(由主要浏览器实现)是什么?

email - 使电子邮件地址免受网页上的机器人攻击?

html - 如何用固定宽度换行 HTML 按钮的文本?

html - 并排的两个 div - 流体显示

html - 设置表格列宽