【问题标题】:bootstrap hidden-lg class is not working in ie9bootstrap hidden-lg 类在 ie9 中不起作用
【发布时间】:2015-04-23 10:56:28
【问题描述】:

Bootstrap hidden-lg 类在 IE 9 中不起作用

hidden-lg 不只在 IE 9 中隐藏指定的元素。

有人知道这个问题吗?

【问题讨论】:

  • 它可以在所有其他浏览器上运行吗?
  • Shajeer,是的,包括 IE10 和 IE11,所有浏览器都在工作。

标签: css twitter-bootstrap internet-explorer-9


【解决方案1】:

要在 IE 9 中使用引导程序,您必须添加 respond.js 和 html5shiva.js,否则媒体查询将不起作用。您可能遗漏了这些内容,请更正您的页面并检查

 <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->

HTML

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
    <h1>Hello, world!</h1>

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>
  </body>
</html>

bootstrap 清楚地解释了这一点 click to read

也阅读this链接

希望一切顺利

【讨论】:

  • 嗨,Shajeer,我已经添加了 shim,回复,但它不起作用
  • 嗨,Shajeer,我遇到了问题,但没有解决,即,当我将 bootstrap.css hidden-md 中的代码翻转到 hidden-lg 时,hidden-lg 正在工作并且 hidden-md 是不工作。
  • @KSSS 你能把你 bootstrap.css 中 hidden-lg 里写的东西粘贴到这里吗
  • 我得到了修复,IE9 它只支持固定数量的 css 规则,这就是为什么它不能从 hidden-lg 工作,谢谢你的时间..
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-09-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-07-17
相关资源
最近更新 更多