o.k*_*k.w 7

嵌套条件(错误):

<!--[if lte IE 8]> 

<!--[if gte IE 6]> 

<!-- your stuff here -->

<![endif]-->

<![endif]-->
Run Code Online (Sandbox Code Playgroud)

编辑: 正如Martha强调的那样,嵌套条件不起作用,使用" &":

<!--[if (lte IE 8) & (gte IE 6)]> 


<!-- your stuff here -->


<![endif]-->
Run Code Online (Sandbox Code Playgroud)

来自MSDN的其他示例:

<!--[if IE]><p>You are using Internet Explorer.</p><![endif]-->
<![if !IE]><p>You are not using Internet Explorer.</p><![endif]>

<!--[if IE 7]><p>Welcome to Internet Explorer 7!</p><![endif]-->
<!--[if !(IE 7)]><p>You are not using version 7.</p><![endif]-->

<!--[if gte IE 7]><p>You are using IE 7 or greater.</p><![endif]-->
<!--[if (IE 5)]><p>You are using IE 5 (any version).</p><![endif]-->
<!--[if (gte IE 5.5)&(lt IE 7)]><p>You are using IE 5.5 or IE 6.</p><![endif]-->
<!--[if lt IE 5.5]><p>Please upgrade your version of Internet Explorer.</p><![endif]-->

<!--[if true]>You are using an <em>uplevel</em> browser.<![endif]-->
<![if false]>You are using a <em>downlevel</em> browser.<![endif]>

<!--[if true]><![if IE 7]><p>This nested comment is displayed in IE 7.</p><![endif]><![endif]-->
Run Code Online (Sandbox Code Playgroud)

  • 您无法嵌套常规的html注释 - 第一个'结束注释'标记将被视为注释的结尾,并且将显示其后的所有内容.额外的"结束评论"标记将被忽略为无效/未知.我不认为这与IE条件评论有任何不同.(如果没有别的,嵌套它们将使你的页面在非IE浏览器中断.) (2认同)