twitter-bootstrap – 为什么Respond.js和CSS3-mediaqueries.js
发布时间:2020-12-17 21:26:45 所属栏目:安全 来源:网络整理
导读:我正在使用Twitter Bootstrap版本2.3.0构建 HTML页面.由于小于9的IE不支持媒体查询,我尝试使用 css3-mediaqueries.js.文档说你需要在所有css之后包含脚本.我做到了下面是我的页面布局. !DOCTYPE html html lang="en" head meta charset="utf-8" meta name="v
我正在使用Twitter Bootstrap版本2.3.0构建
HTML页面.由于小于9的IE不支持媒体查询,我尝试使用
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> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容