在IE10中,滚动条并不总是存在的……当它出现时以覆盖的形式出现……这是一个很酷的功能,但是我想为我的特定网站关闭它,因为它是一个全屏应用程序,而我徽标和菜单丢失了。
搜寻了一下之后,我偶然发现了一个讨论,其中“蓝墨水”留下的评论指出:
检查页面,我设法使用以下方法重现了这些页面:
@ -ms-viewport {width:device-width; }
这会导致滚动条变得透明。这是有道理的,因为内容现在占据了整个屏幕。
在这种情况下,添加:
溢出-y:自动;
使滚动条自动隐藏
// IE10 in Windows (Phone) 8 // // Support for responsive views via media queries is kind of borked in IE10, for // Surface/desktop in split view and for Windows Phone 8. This particular fix // must be accompanied by a snippet of JavaScript to sniff the user agent and // apply some conditional CSS to *only* the Surface/desktop Windows 8. Look at // our Getting Started page for more information on this bug. // // For more information, see the following: // // Issue: https://github.com/twbs/bootstrap/issues/10497 // Docs: http://getbootstrap.com/getting-started/#support-ie10-width // Source: http://timkadlec.com/2013/01/windows-phone-8-and-device-width/ // Source: http://timkadlec.com/2012/10/ie10-snap-mode-and-responsive-design/ @-ms-viewport { width: device-width; }
此代码段是导致此问题的原因。我建议阅读上面注释代码中列出的链接。(它们是在我最初发布此答案后添加的。)