Search code examples
htmlinternet-explorer-7conditional-comments

How to write conditional comment for non IE browsers?


I don't want to use a couple of javascript plugins for IE 6/7. But I want to use them for all other browsers.

How can I do it? Is there any way I can do it?


Solution

  • From the Wikipedia article on conditional comments (modified to fit your version requirements):

    <!--[if gt IE 7]><!-->
    <p>This code displays on non-IE browsers and on IE 8 or higher.</p>
    <!--<![endif]-->
    

    The weird markup in the first line serves to make the markup standards compliant.