我目前正在运行这段代码。我还有一个外部样式表,可以正确应用我所有的页面样式,但我目前正在这个问题中运行。
当我在外部样式表中调用 .ie9 作为类并希望对其应用渐变样式时,它不会在 Internet Explorer 仿真中运行我的代码。
但是,当我运行不在 .ie9 类中的代码时,代码实际上可以工作,所以我在某处犯了一些错误。也许您可能知道这里的问题是什么。
网页代码:
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--><html lang="nl-NL"> <!--![endif]-->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
CSS代码:
.ie9 {
.section-example{
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#80c9db', EndColorStr='#30aac8');
}
}
问题实际上是不同的。由于某种原因,Internet Explorer 11 模拟器不会加载条件 html 语句。
可能它适用于大于 ie9:-
<!--[if gte IE 9]>
<link rel="stylesheet" type="text/css" href="ie9-and-up.css" />
<![endif]-->
或
<!--[if lt IE 9]>
<link href="<?php bloginfo( 'template_url' ); ?>/css/ie9.css" rel="stylesheet" type="text/css" />
<![endif]-->