Search code examples
htmlinternet-explorerconditional-comments

IE conditional comments 'and'?


Is it possible to insert an 'and' in a conditional comment?

For example:

<!--[if gte IE 9 && if !IE]>
// MESSAGE
<![endif]-->

Triggering only IE 9, higher versions of IE and browsers that are not IE?


Solution

  • The & operator is not even necessary. This code will run in non-IE browsers and in IE 9 and higher, according to the syntax description on Wikipedia:

    <!--[if gt IE 9]><!-->
    // MESSAGE
    <!--<![endif]-->