[英]CSS Stylesheets does't apply on IE7 and 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>
鍍鉻頭
IE8頭
我認為這可能與DOCTYPE有關,因此我更改為HTML4,但仍然無法正常工作。 另請注意,它可以在IE8瀏覽器模式和文檔模式下以怪癖的形式運行,但在標准模式下則不起作用
您正在使用條件注釋。
<!--[if gt IE 8]><!--><html class="no-js">
<head>
您永遠不會結束gt IE8的<html>
開始標記的concom。 與之匹配的瀏覽器將隱藏下一個注釋之前的所有內容。
添加<!--<![endif]-->
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.