【问题标题】:Where to write Bootstrap options for ms viewport?在哪里为 ms 视口编写 Bootstrap 选项?
【发布时间】:2014-10-10 21:26:22
【问题描述】:

我正在开发一个使用 Bootstrap UI 的 Web 应用程序。 不过其他浏览器看起来不错,但在 IE 10 版本中,UI 看起来很糟糕。

我在 bootstrap 官方网站上找到了解决方案。 它建议如下:

把它放在你的 CSS 和 JS 上。

CSS:

@-ms-viewport       { width: device-width; }
@-webkit-viewport   { width: device-width; }
@-moz-viewport      { width: device-width; }
@-ms-viewport       { width: device-width; }
@-o-viewport        { width: device-width; }
@viewport           { width: device-width; }

JS

if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
    var msViewportStyle = document.createElement('style')
    msViewportStyle.appendChild(
        document.createTextNode(
            '@-ms-viewport{width:auto!important}'
        )
    )
    document.querySelector('head').appendChild(msViewportStyle)
}

这就是我所做的:我将该 CSS 复制到位于 css 文件夹下的 your_style.css => 这不起作用,我不知道在哪里插入这个 JavaScript。

【问题讨论】:

    标签: css twitter-bootstrap jquery-ui cross-browser internet-explorer-10


    【解决方案1】:

    这是一个带有明确说明的问题/答案

    Confused with Bootstrap Internet Explorer 10 in Windows 8 and Windows Phone 8

    我建议的一件事是确保在 ie10 中未启用兼容模式.. 我过去遇到过这个问题。

    兼容模式切换,在此图中突出显示:

    【讨论】:

      猜你喜欢
      • 2019-12-14
      • 1970-01-01
      • 1970-01-01
      • 2015-03-29
      • 2014-12-11
      • 1970-01-01
      • 1970-01-01
      • 2014-09-27
      • 2019-05-11
      相关资源
      最近更新 更多