2013-04-20 76 views
0

這是我的代碼。當使用ie時,我希望它顯示「請更改您的瀏覽器!」,並且只有非ie瀏覽器才能看到其他代碼。但它不能在ie10中工作(即10不顯示h1但是其他代碼)我的代碼有什麼問題?目標ie和非即不工作?我ie版本的ie10

<!doctype html> 
<html> 
<head> 
<meta charset="utf-8"> 
<title>Sisu|Swap</title> 
<link type="text/css" rel="stylesheet" href="1.css"> 
</head> 
<body> 
<!--[If IE]> 
<h1 style="color: white">please change your browser!</h1> 
<![endif]--> 
<!--[if !IE]>--> 
    <header> 
    <img src="imgs/header.jpg" /> 
    </header> 

    <footer> 

    </footer> 

</body> 
</html> 
<!--<![endif]--> 
+0

可能的重複[如何僅針對特定情況下的Internet Explorer 10,如Internet Explorer特定的CSS或Internet Explorer特定的JavaScript代碼?](http://stackoverflow.com/questions/9900311/how- do-i-target-only-internet-explorer-10-for-certain-circumstances-like-internet-e) – Zeta 2013-04-20 07:07:53

+0

如果有理由因功能缺失而排除IE10,則應該使用功能檢測將其排除缺少功能而不是按名稱。 – 2013-04-20 07:10:10

+0

[不要這樣做](http://stackoverflow.com/questions/16066175/browser-support-message-pop-up-plugin/16072651#16072651)。 – Sampson 2013-04-21 03:08:12

回答