2014-04-01 50 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

太棒了!我的錯誤謝謝 –