2014-04-01 51 views
0

我遇到问题,该网站仍在我的本地主机。 CSS链接不包含在页面中的地方。它适用于所有其他浏览器,期望IE7和IE8。CSS样式表不适用于IE7和IE8

我在使用WordPress 3.6,Bootstrap 3,Modernizr和jQuery。

源代码

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> 
<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8 ie-7"> <![endif]--> 
<!--[if IE 8]><html class="no-js lt-ie9 ie-8"> <![endif]--> 
<!--[if IE 9]><html class="no-js lt-ie9 ie-9"> <![endif]--> 
<!--[if gt IE 8]><!--><html class="no-js"> 
     <head> 
     <meta charset="utf-8"> 
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
     <title><?php echo title(); ?></title> 
     <meta name="description" content=""> 
     <meta name="viewport" content="width=device-width"> 
     <link rel="stylesheet" type="text/css" href="<?php echo CSS_PATH; ?>/bootstrap.css"/> 
     <link rel="stylesheet" type="text/css" href="<?php echo CSS_PATH; ?>/bootstrap-theme.css"/> 
     <link href='http://fonts.googleapis.com/css?family=Maven+Pro:400,700' rel='stylesheet' type='text/css'> 
     <link rel="stylesheet" type="text/css" href="<?php echo CSS_PATH; ?>/common.css"/> 
     <?php if(is_front_page()){ ?><link rel="stylesheet" type="text/css" href="<?php echo CSS_PATH; ?>/home.css"/><?php } ?> 
     <link rel="stylesheet" type="text/css" href="<?php echo CSS_PATH; ?>/media.css"/> 
     <link rel="stylesheet" type="text/css" href="<?php echo CSS_PATH; ?>/print.css" media="print"/> 
     <script type="text/javascript" src="<?php echo JS_PATH; ?>/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script> 
     <script type="text/javascript">var template = '<?php echo get_template_directory_uri(); ?>';</script> 
    </head> 

铬头 enter image description here

IE8头 enter image description here

我想这可能是一些与DOCTYPE这样做,我改HTML4,但stil它不工作。另请注意,它在IE8浏览器模式和文档模式下可用作怪癖,但在标准模式下不起作用

+1

'如果gt IE 8'缺少'endif'。 –

+1

我看到没有关闭的最后<! - [如果gt IE 8]> – MJoraid

+0

谢谢你们,它的作品 –

回答

3

您正在使用条件注释。

<!--[if gt IE 8]><!--><html class="no-js"> 
     <head> 

你永远不会结束对于IE8的<html>开始标记的控制权。下一条评论前的所有内容都隐藏在与之匹配的浏览器中。

添加<!--<![endif]-->

+0

太棒了!我的错误谢谢 –