[英]Bootstrap 3 and IE8 issue
我正在使用Bootstrap 3框架进行新设计。 一切都可以在Safari,Chrome和Firefox中正常运行,但在IE8中则不能。 我已经在我的functions.php文件中添加了response.min.js和html5shiv.js。 如我在Chrome的“检查元素->资源”中所见,这些文件已加载。
尽管如此,在IE8中,该站点仍按移动设备显示,这是不正确的。
如何解决呢?
我的头标签:
<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>
如果要在本地尝试,请尝试通过localhost或创建QA服务器并设置内容并尝试。
我们需要bootstrap 3的response.js,如果仅将其放入js并将其附加到标头中的html,它将无法在本地计算机上工作。
它将说access denied
,由于IE具有安全限制,因此只能通过服务器工作。
使用Googling Bootstrap 3 IE 8时,最出色的结果之一是: http : //www.telegraphicsinc.com/2013/10/using-bootstrap-3-with-internet-explorer-8-ie8/
最终,它说您需要添加“”,您可以从此处获取它: https : //code.google.com/p/css3-mediaqueries-js/
Bootstrap将在IE 8中运行,请按照以下步骤进行操作:
添加下面提到的脚本不要使用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 -->
注意:添加序列非常重要
首先添加您的CSS,然后添加这些js
Bootstrap.css
YourCustom.css
Response.js
html5shiv.js
Bootstrap IE支持详细信息: http : //getbootstrap.com/getting-started/#support
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.