0

这是我的代码。使用 ie 时,我希望它显示“请更换您的浏览器!”,并且只有非 ie 浏览器才能看到其他代码。但它在 ie10 中不起作用(即 10 不显示 h1 但其他代码)我的代码有什么问题?

<!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]--> 
4

1 回答 1

3

Internet Explorer 10 不支持条件注释,请参阅有关条件注释的 MSDN 页面

重要  从 Internet Explorer 10 开始,标准模式不再支持条件注释。使用功能检测为浏览器不支持的网站功能提供有效的后备策略。有关标准模式的更多信息,请参阅定义文档兼容性

于 2013-04-20T07:05:55.577 回答