gpt4 book ai didi

twitter-bootstrap - 为什么 Respond.js 和 CSS3-mediaqueries.js 都不适用于我的 IE 7 和 8?

转载 作者:行者123 更新时间:2023-12-04 08:58:35 25 4
gpt4 key购买 nike

我正在使用 Twitter Bootstrap 2.3.0 版构建一个 HTML 页面。由于 IE 小于 9 不支持媒体查询,我尝试使用 css3-mediaqueries.js。文档说你只需要在所有 css 之后包含脚本。我这样做了。下面是我的页面布局。

   <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Responsive page">
<meta name="author" content="Author name">
<title>Responsive page built on Twitter Bootstrap</title>
<link href="css/bootstrap.min.css" rel="stylesheet" type='text/css'>
<link href="css/bootstrap-responsive.min.css" rel="stylesheet" type='text/css'>
<link href="css/my-page.css" rel="stylesheet" type='text/css'>
<link href="css/my-page-responsive.css" rel="stylesheet" type='text/css'>
</head>
<body>
<div class="container">
<!-- My html goes here -->
</div>
<!--[if lt IE 9]>
<script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js">
</script> <![endif]-->
</body>
</html>

但仍然没有运气。我没有在我的页面中使用任何 HTML5 元素。 javascript控制台中没有记录错误。

然后我尝试使用会引发以下异常的respond.js。
Unspecified error.
respond.js, line 309

我在这里做错了什么?

最佳答案

您仍然需要将脚本放在您的 <head> 中。 ,就在你的样式表之后。将它放在文档的底部会导致页面在脚本加载到内存之前呈现。

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Responsive page">
<meta name="author" content="Author name">
<title>Responsive page built on Twitter Bootstrap</title>
<link href="css/bootstrap.min.css" rel="stylesheet" type='text/css'>
<link href="css/bootstrap-responsive.min.css" rel="stylesheet" type='text/css'>
<link href="css/my-page.css" rel="stylesheet" type='text/css'>
<link href="css/my-page-responsive.css" rel="stylesheet" type='text/css'>
<!--[if lt IE 9]>
<script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
<![endif]-->
</head>

关于twitter-bootstrap - 为什么 Respond.js 和 CSS3-mediaqueries.js 都不适用于我的 IE 7 和 8?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15099554/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com