如何防止IE10中的滚动条覆盖内容? [英] How can I prevent the scrollbar overlaying content in IE10?

查看:215
本文介绍了如何防止IE10中的滚动条覆盖内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

In IE10, the scrollbar is not always there... and when it appears it comes on as an overlay... It's a cool feature but I would like to turn it off for my specific website as it is a full screen application and my logos and menus are lost behind it.

IE10:

铬:

有人知道一种将滚动条固定在IE10上的方法吗?

Anyone know a way of always having the scrollbar fixed in position on IE10?

overflow-y:scroll似乎不起作用!它只是将其永久地放在我的网站上.

overflow-y:scroll doesn't seem to work! it just puts it permanently over my website.

可能是导致问题的引导程序,但是我不知道哪一部分!在此处查看示例: http://twitter.github.io/bootstrap/

推荐答案

搜索了一下之后,我偶然发现了一个讨论,其中蓝墨水"留下的评论是这样的:

After googling a bit I stumbled across a discussion where a comment left by "Blue Ink" states:

检查页面,我设法使用以下方法重现它:

Inspecting the pages, I managed to reproduce it by using:

@-ms-viewport {width:device-width; }

@-ms-viewport { width: device-width; }

这将导致滚动条变得透明.有道理,因为 现在,内容占据了整个屏幕.

which causes the scrollbars to become transparent. Makes sense, since the content now takes up the whole screen.

在这种情况下,添加:

overflow-y:自动;

overflow-y: auto;

使滚动条自动隐藏

并且在引导程序中sensitive-utilities.less文件,第21行,您可以找到以下CSS代码

And in bootstraps responsive-utilities.less file, line 21 you can find the following CSS code

// 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;
}

此代码段是导致此问题的原因.我建议阅读上面注释代码中列出的链接. (它们是在我最初发布此答案后添加的.)

This snippet is what's causing the behavior. I recommend reading the links listed in the commented code above. (They were added after I initially posted this answer.)

这篇关于如何防止IE10中的滚动条覆盖内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆