简体   繁体   English

Bootstrap 3和IE8问题

[英]Bootstrap 3 and IE8 issue

I'm using Bootstrap 3 framework for a new design. 我正在使用Bootstrap 3框架进行新设计。 All works fine in Safari, Chrome and Firefox, but not in IE8. 一切都可以在Safari,Chrome和Firefox中正常运行,但在IE8中则不能。 I've added respond.min.js and html5shiv.js in my functions.php file. 我已经在我的functions.php文件中添加了response.min.js和html5shiv.js。 Those files get loaded as I can see in 'inspect-element -> resources" in Chrome. 如我在Chrome的“检查元素->资源”中所见,这些文件已加载。

Still, in IE8, the site is displayed as is is a mobile device, which isn't correct. 尽管如此,在IE8中,该站点仍按移动设备显示,这是不正确的。

How to resolve this? 如何解决呢?

my head tag: 我的头标签:

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Bootstrap core CSS -->
    <link href="css/modern-business.css" rel="stylesheet">
    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link href="css/bootstrap.css" rel="stylesheet" media="screen">
    <script src="js/jquery.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/modern-business.js"></script>
     <!--[if lt IE 9]>
      <script src="js/html5shiv.js"></script>
      <script src="js/respond.js"></script>
    <![endif]-->  
    </head>

If you want to try in local, try through localhost, or create a QA server and set the content and try. 如果要在本地尝试,请尝试通过localhost或创建QA服务器并设置内容并尝试。

We need respond.js for bootstrap 3 and it wont work in local machine if we just put it in js and append it to html in header. 我们需要bootstrap 3的response.js,如果仅将其放入js并将其附加到标头中的html,它将无法在本地计算机上工作。

It will say access denied , it works only through server as IE has security restriction. 它将说access denied ,由于IE具有安全限制,因此只能通过服务器工作。

When Googling Bootstrap 3 IE 8 one of the top results is: http://www.telegraphicsinc.com/2013/10/using-bootstrap-3-with-internet-explorer-8-ie8/ 使用Googling Bootstrap 3 IE 8时,最出色的结果之一是: http : //www.telegraphicsinc.com/2013/10/using-bootstrap-3-with-internet-explorer-8-ie8/

Ultimately it says you need to add, "" which you can grab from here: https://code.google.com/p/css3-mediaqueries-js/ 最终,它说您需要添加“”,您可以从此处获取它: https : //code.google.com/p/css3-mediaqueries-js/

Bootstrap will work in IE 8, to do the same follow below steps: Bootstrap将在IE 8中运行,请按照以下步骤进行操作:

Add below mentioned Scripts Dont use CDN for the same its worth to add those scripts from local folder 添加下面提到的脚本不要使用CDN来添加本地文件夹中的脚本

<!-- language: lang-html -->

    <!--[if lt IE 9]>
          <script src="../../scripts/IE8/html5shiv.js"></script>
          <script src="../../scripts/IE8/respond.min.js"></script>
        <![endif]-->


<!-- end snippet -->

Download Respond.js And Html5Shiv.js 下载Respond.jsHtml5Shiv.js

Note: Adding Sequence would be very important 注意:添加序列非常重要

Add your css first then add those js 首先添加您的CSS,然后添加这些js

Bootstrap.css Bootstrap.css
YourCustom.css YourCustom.css
Respond.js Response.js
html5shiv.js html5shiv.js

Bootstrap IE Support details : http://getbootstrap.com/getting-started/#support Bootstrap IE支持详细信息: http : //getbootstrap.com/getting-started/#support

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM