2

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.

TylerH
  • 20,799
  • 66
  • 75
  • 101
Alistair
  • 1,939
  • 2
  • 22
  • 31

3 Answers3

3

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
  • 21,302
  • 14
  • 69
  • 94
  • The first conditional comment above will prevent IE 6 & 7 from loading maincss.css ("mincss.css"?) so it will *not* crash them. IE8+ will see the "gte IE 8" and load it, other browswers will ignore the conditional comment so they will load it. – Stephen P Apr 23 '10 at 00:09
  • Actually for whatever reason IE7 is loading the maincss.css when I use conditional comments. – Alistair Apr 23 '10 at 00:30
3

Use the html>/**/body hack.

html>/**/body .someclass {
    /* Will be applied on everything but IE6/IE7. */
}
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
1

Conditional Comments work very well for problems such as this.

Ken Browning
  • 28,693
  • 6
  • 56
  • 68