Search code examples
htmlcssinternet-explorer

Non-IE6 IE7 hack


I managed to create a page the crashes IE6 and 7 regularly as per here: http://raven-seo-tools.com/blog/2675/crash-ie6-with-only-css

I have a solution for non-IE browsers (display: inline-block), but the only way to get IE6/7 working is to use different CSS (display: inline). Normally I would have other browsers use inline-block, then in a seperate IE67 CSS file I would set display to inline.

The problem is IE67 crash as soon as they reach the display: inline-block line, so I need a way to hide this code from IE6 and 7 but not other browsers.

UPDATE:

Conditional Comments are not an option! IE67 crash as soon as they reach the line for other browers, so the conditional css will never run. I need a way to hide this line from IE67. Contional Comments don't allow you to hide CSS from IE67.

UPDATE 2:

Ok, looks like conditional comments are an option. Giving the right answer to the person who gave me exactly what I was looking for though.


Solution

  • Use the html>/**/body hack.

    html>/**/body .someclass {
        /* Will be applied on everything but IE6/IE7. */
    }