【发布时间】:2013-12-30 16:07:48
【问题描述】:
我在 23 岁时将我的网站创建为 Wordpress 的子主题。我已经集成了 Bootstrap,一切正常。 IE8 除外。页面一直卡在移动视图中。
我已按照 Bootstraps 页面上的说明,并在我的 CSS 之后的 head-tag 中包含了 respond.js。我还包括了 html5shiv。但它仍然是一样的,页面是 100% 宽度并且都是一列。
我也尝试将 http-equiv 设置为 x-ua-compatible。我的头部标签如下所示:
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<script src="<?php echo get_stylesheet_directory_uri(); ?>/js/respond.min.js"></script>
<![endif]-->
</head>
我的 LESS 样式表是这样开始的:
我知道 response 不适用于使用 @import 导入的 CSS,但第一次导入中的 CSS 不需要由 respond.js 操作,并且 Bootstrap-import 是 LESS 导入,因此生成的 CSS将整个引导程序和我自己的引导程序放在同一个文件中。
/*
Theme Name: Public Web
Description: Public Web theme, responsive and HTML5 compatible
Author: Me
Author URI: http://stinaq.me
Template: twentythirteen
Version: 1.0.0
*/
@import url("../twentythirteen/style.css");
@import "bootstrap/bootstrap-min.less";
我尝试过Bootstrap的缩小版和常规版,以及IE(兼容模式和真正的IE8。respond.js是浏览器找到的,所以也不可能。
编辑:
我在本地 XAMPP 服务器上运行该站点,因此不尝试通过 //file 而是通过 localhost 访问 response.js
【问题讨论】:
-
在视口元标记中添加
intial-scale=1.0怎么样?你试过吗?所以<meta name="viewport" content=width=device-width, initial-scale=1.0"> -
现在试过了,没用
-
我总是检查任何我试图在上面进行兼容性测试的站点的服务器日志。通常这是浪费时间,因为您没有使用 IE8 的访问者。检查并节省一些时间。
标签: css wordpress twitter-bootstrap internet-explorer-8