这令人难以置信的令人沮丧,无论我做什么,if IE 语句似乎都不起作用
我正在使用 IE 10
这是代码:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<!--[if IE]>
<h1>You are using Internet Explorer</h1>
<![endif]-->
</body>
</html>
这令人难以置信的令人沮丧,无论我做什么,if IE 语句似乎都不起作用
我正在使用 IE 10
这是代码:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<!--[if IE]>
<h1>You are using Internet Explorer</h1>
<![endif]-->
</body>
</html>
如果有人仍然访问此页面,想知道为什么 ie 定位不起作用。IE 10 及更高版本不再支持条件注释。来自微软官方网站:
Internet Explorer 10 标准和怪癖模式已删除对条件注释的支持,以提高互操作性和与 HTML5 的合规性。
请在此处查看更多详细信息:http: //msdn.microsoft.com/en-us/library/ie/hh801214 (v=vs.85).aspx
如果您迫切需要以 ie 为目标,您可以使用此 jquery 代码添加一个 ie 类,然后在您的 css 中使用 .ie 类来定位 ie 浏览器。
if ($.browser.msie) {
$("html").addClass("ie");
}