Bootstrap CDN Does Not Work In IE8
I am trying to publish my website using Bootstrap CDN and want it to work correctly in IE8. However, when referencing the Bootstrap CSS on my web server, Bootstrap works perfectly
Solution 1:
What caused the problem is the limitation of respond.js. According to README of respond.js, respond.js can not parse s hosted on CDNs by default. So, adding codes is required. The following is the example working correctly in IE8.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>brief example</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<!--[if lt IE 9]>
<script type="text/javascript" src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script type="text/javascript" src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/.html" id="" />
<link href="respond.proxy.gif" id="" />
<script src="respond.proxy.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="row">
<div class="col-sm-6">
left side
</div>
<div class="col-sm-6">
right side
</div>
</div>
</div>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</body>
</html>
respond.proxy.gif
is the file downloaded from https://github.com/scottjehl/Respond/raw/1.4.2/cross-domain/respond.proxy.gif
.
respond.proxy.js
is the file downloaded from https://github.com/scottjehl/Respond/raw/1.4.2/cross-domain/respond.proxy.js
.
Solution 2:
Instead of
https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
Use
//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
(omit the "https:")
Solution 3:
I think, this is not problem. Try to run your project from any server. like localhost
or webserver
. I prefer to use webserver
. May be problem will be solved.
Post a Comment for "Bootstrap CDN Does Not Work In IE8"