这是非常简单的HTML页面,我试图在IE 11上渲染,但不知怎么从来没有采取IE特定的css文件。
我在这里附加我的密码。
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="images/favicon.ico">
<title>Demo</title>
<!-- Custom styles for this template -->
<link href="css/style.css" rel="stylesheet">
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/all-ie-only.css" />
<![endif]-->
</head>
<body class="subpage">
</body>
</html>
我的css包含:
style.css
body{background:blue;}
all-ie-only.css
body{background:red;}
注意:,我已经从类似的问题中引用并尝试了解决方案,如下所示,但没有运气。
ie only stylesheet not working, code included
我尝试过的解决方案:
<script>
/*@cc_on
@if (@_jscript_version == 11)
document.write("You are using IE11 with an older document mode");
@elif (@_jscript_version == 10)
document.write("You are using IE10");
@elif (@_jscript_version == 9)
document.write("You are using IE9");
@elif (@_jscript_version == 5.8)
document.write("You are using IE8");
@elif (@_jscript_version == 5.7 && window.XMLHttpRequest)
document.write("You are using IE7");
@elif (@_jscript_version == 5.6 || (@_jscript_version == 5.7 && !window.XMLHttpRequest))
document.write("You are using IE6");
@elif (@_jscript_version == 5.5)
document.write("You are using IE5.5");
@elif (@_jscript_version < 5.5)
document.write("You are using a version older than IE5.5");
@else
document.write("You are using an unknown version of IE");
@end
@*/
</script>
我尝试过的是这样的建议:comment
似乎,它从未进入指定"@_jscript_version“的条件。任何进一步的帮助都很感激。
发布于 2018-09-26 13:30:12
IE10和IE11不支持条件注释。
IE10和IE11不再支持条件注释。 comment
https://stackoverflow.com/questions/52518915
复制相似问题