如何使IE8上的Bootstrap响应式布局工作 [英] How to make Bootstrap responsive layout work on IE8
问题描述
我已经搜索了一段时间,发现有些人让它工作,但没有一个提供任何代码示例。
I've been search for a while and found some people got it working, but none of them provide any code samples.
我尝试了他们的建议,但它没有不适合我。根据建议,我尝试添加< meta http-equiv =X-UA-Compatiblecontent =IE = edge/>
, respond.js
或 css3-mediaqueries-js
,但都没有帮助。
I tried their suggestions but it didn't work for me. By suggestions, I tried adding <meta http-equiv="X-UA-Compatible" content="IE=edge" />
, respond.js
or css3-mediaqueries-js
, but none of them helped.
这是一个 jsfiddle ,如果你用IE8查看它,你会看到 a
和 b
都在同一行。
Here's a jsfiddle, if you view it with IE8, you'll see both a
and b
are on the same row regardless of your browser width.
但如果您使用Chrome,FF或IE9或更高版本查看,您会在不同的行或单行上看到它们,具体取决于浏览器的宽度。
But if you view with Chrome, FF or IE9 or above, you'll see them on different rows or single row depending on the browser width.
UPDATE
我试图取消注释其中一个(css3-mediaquery,html5shiv并回复)at一段时间,但没有任何一个运气。
I tried to uncomment one of them (css3-mediaquery, html5shiv and respond) at a time but got no luck with any one of them.
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/latest/css/bootstrap-combined.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row">
<div class="span4">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</div>
<div class="span8">
LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT.
</div>
</div>
</div>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="http://netdna.bootstrapcdn.com/twitter-bootstrap/latest/js/bootstrap.min.js"></script>
<%--<script type="text/javascript" src="js/css3-mediaqueries.js"></script>--%>
<%--<script type="text/javascript" src="js/html5shiv.js"></script>--%>
<%--<script type="text/javascript" src="js/respond.js"></script>--%>
</script>
</body>
</html>
推荐答案
IE 8不支持媒体查询框。
IE 8 doesn't support media queries out of the box.
基于此问题和这个问题 ,您将要使用 css3-mediaqueries-js 或回应。
Based on this question and this question, you're going to want to use an extension like css3-mediaqueries-js or Respond.
这篇关于如何使IE8上的Bootstrap响应式布局工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!