views:

117

answers:

3
+2  Q: 

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.

+1  A: 

Conditional Comments work very well for problems such as this.

Ken Browning
+3  A: 

These conditional comments might work. mincss.css is loaded in IE8 and other browsers, while ie6-7.css is loaded in IE7 and below.

<!-- <![if (!IE)|(gte IE 8)]> -->
    <link rel="stylesheet" href="maincss.css" type="text/css" />
<!-- <![endif]> -->
<!-- <![if (lte IE 7)]>
    <link rel="stylesheet" href="ie6-7.css" type="text/css" />
<![endif]> -->
MiffTheFox
See the update I just made. not an option
Alistair
Stephen P
Ah I see, thanks for the info.
Alistair
Actually for whatever reason IE7 is loading the maincss.css when I use conditional comments.
Alistair
+3  A: 

Use the html>/**/body hack.

html>/**/body .someclass {
    /* Will be applied on everything but IE6/IE7. */
}
BalusC
Works! Thanks! That is a great reference.
Alistair
You're welcome.
BalusC