【发布时间】:2013-07-05 15:00:05
【问题描述】:
我正在使用 twitter bootstrap 实现一个响应式网站,但在 iexplorer 8 及更低版本上无法使用媒体查询。
我为 try respond.js 创建了一个简单的示例,但媒体查询在 iexplorer 7-8 上仍然无法正常工作,这是 html:
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>Bootstrap 101 Template</title>
<meta name="Description" content="Web description here" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<link href="./css/styles.css" rel="stylesheet">
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="shortcut icon" href="./img/favicon.png">
</head>
<body>
<div class="container">
<h1>Hello, world!</h1>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script src="./js/respond.min.js"></script>
<script src="./js/scripts.js"></script>
</body>
</html>
这里是 style.css:
@media only screen and (max-width: 38.75em) {
body {
background: green;
}
}
问候
【问题讨论】:
标签: internet-explorer-8 internet-explorer-7 respond.js