IE11条件CSS注释不起作用

Ale*_*x M -1 html css internet-explorer conditional-comments internet-explorer-11

我尝试了几种条件格式,如在不同的网站中看到的,但似乎无法使其工作.浏览器版本是IE 11.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">

<title></title>
<link href="CSS/reset.css" rel="stylesheet" />
<link href="css/bootstrap.min.css" rel="stylesheet" />
<link href="CSS/font-awesome.css" rel="stylesheet" />
<!--[if !IE]><!--><link rel="stylesheet" type="text/css" href="CSS/login.css" /><!--<![endif]-->
<!--[if IE]><!--><link rel="stylesheet" type="text/css" href="CSS/loginIE.css" /><!--<![endif]-->
Run Code Online (Sandbox Code Playgroud)

我已经改变了格式.删除Bootstrap和Fontawesome CSS但仍然无法正常工作.我甚至更改/删除了doctype和meta值,但没有任何效果.请帮忙.

dip*_*pas 6

IE10 +没有条件评论,请看这里

Internet Explorer 10标准和怪癖模式中已删除对条件注释的支持,以提高互操作性并符合HTML5.这意味着条件注释现在被视为常规注释,就像在其他浏览器中一样.此更改可能会影响专门为Windows Internet Explorer编写的页面或使用浏览器嗅探来改变其在Internet Explorer中的行为的页面.

你可以尝试使用IE浏览器IE10和IE11

这样的事情:

/*IE10 and IE11*/

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .selector { property:value; }
}
Run Code Online (Sandbox Code Playgroud)