Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 不管我做什么,有条件的工作都不起作用_Html_Internet Explorer_Conditional - Fatal编程技术网

Html 不管我做什么,有条件的工作都不起作用

Html 不管我做什么,有条件的工作都不起作用,html,internet-explorer,conditional,Html,Internet Explorer,Conditional,这是令人难以置信的沮丧,如果IE声明似乎不工作,无论我做什么 我用的是IE 10 代码如下: <!DOCTYPE html> <html> <head> <title></title> </head> <body> <!--[if IE]> <h1>You are using Internet Explorer</h1> <![endif]--> <

这是令人难以置信的沮丧,如果IE声明似乎不工作,无论我做什么

我用的是IE 10

代码如下:

<!DOCTYPE html>
<html>
<head>
<title></title>

</head>
<body>
<!--[if IE]> 
<h1>You are using Internet Explorer</h1> 
<![endif]--> 

</body>
</html>

您遇到的问题是,条件注释在Internet Explorer 10中不起作用,并且不推荐使用

参考资料:

  • “.”

如果有人仍然访问此页面,想知道为什么ie定位不起作用。IE 10及以后版本不再支持有条件评论。从微软官方网站:

Internet Explorer中已删除对条件注释的支持 10个标准和怪癖模式,用于改进互操作性和 遵守HTML5

有关更多详细信息,请参见此处:

如果您迫切需要以ie为目标,可以使用此jquery代码向添加ie类,然后使用css中的.ie类以ie浏览器为目标

if ($.browser.msie) {
 $("html").addClass("ie");
}

我只能向你指出这个问题(除其他问题外):@huntingbears:不要。使用功能检测。我有一个从左边对齐的400px图像,在IE中,它的宽度不够远,就像它从后面开始400px一样,不管怎么说??没有看到你的HTML和CSS,没有。可能是