Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.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 <--[如果IE]>;不在任何浏览器中工作_Html_Css_Internet Explorer_If Statement - Fatal编程技术网

Html <--[如果IE]>;不在任何浏览器中工作

Html <--[如果IE]>;不在任何浏览器中工作,html,css,internet-explorer,if-statement,Html,Css,Internet Explorer,If Statement,嗨,我有一个非常奇怪的问题,搜索谷歌的答案没有成功 我只希望在IE中身体背景颜色变为红色,但它不起作用 我有下面的HTML <!DOCTYPE html> <head> <!--[if IE]> <style type="text/css"> body {background-color:red;} </style> <![endif]--> </head> &

嗨,我有一个非常奇怪的问题,搜索谷歌的答案没有成功

我只希望在IE中身体背景颜色变为红色,但它不起作用

我有下面的HTML

<!DOCTYPE html>

<head>
    <!--[if IE]>
    <style type="text/css">
        body {background-color:red;}
    </style>
    <![endif]-->
</head>

<body>TEST</body>

</html>

试验
我正在测试IE 11以及最新版本的Chrome和FF


有什么想法吗?

IE10和IE11中不支持条件注释,因为这些浏览器与HTML5相当兼容(无论如何,按照IE标准)。有关更多详细信息,请参见

从IE 5到IE 9只支持条件注释。
请参阅链接:

@DK64这是IED的一个有条件的注释您必须删除它们@Harvey,因为它们不受支持,而且您还忘记了
-
之前的
[endif]
@user689这是if的正确语法-,如果-,则只会在有和没有的情况下添加