简体   繁体   English

IE11 条件 CSS 注释不起作用

[英]IE11 Conditional CSS Comment does not work

I have tried several conditional formats as seen in different sites but can't seem to get this to work.我已经尝试了在不同站点上看到的几种条件格式,但似乎无法使其正常工作。 Browser version is IE 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]-->

I already changed the format.我已经改变了格式。 removing Bootstrap and Fontawesome CSS but still not working.删除 Bootstrap 和 Fontawesome CSS 但仍然无法正常工作。 I even changed/removed the doctype and meta values but nothing worked.我什至更改/删除了文档类型和元值,但没有任何效果。 Please help.请帮忙。

There is no Conditional comments for IE10+, take a lookhere IE10+没有条件注释,看这里

Support for conditional comments has been removed in Internet Explorer 10 standards and quirks modes for improved interoperability and compliance with HTML5. Internet Explorer 10 标准和怪癖模式中删除了对条件注释的支持,以提高互操作性和与 HTML5 的合规性。 This means that Conditional Comments are now treated as regular comments, just like in other browsers.这意味着条件注释现在被视为常规注释,就像在其他浏览器中一样。 This change can impact pages written exclusively for Windows Internet Explorer or pages that use browser sniffing to alter their behavior in Internet Explorer.此更改可能会影响专为 Windows Internet Explorer 编写的页面或使用浏览器嗅探来更改其在 Internet Explorer 中的行为的页面。

you can try using IE hacks for IE10 and IE11您可以尝试对 IE10 和 IE11 使用 IE hacks

something like this:像这样:

/*IE10 and IE11*/

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

Conditional comments are no longer supported after IE10 : IE10 之后不再支持条件注释

Support for conditional comments has been removed in Internet Explorer 10 standards and quirks modes for improved interoperability and compliance with HTML5. Internet Explorer 10 标准和怪癖模式中删除了对条件注释的支持,以提高互操作性和与 HTML5 的合规性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM