Question

I have a page that's not displaying correctly in ie8 quirks mode. If I want to create some CSS to target just that mode, but not ie8 normally, what would be the conditional HTML?

For example, if I wanted to just hit ie8:

<!--[if IE 8]>
    awesome hacky stuff goes here
<![endif]-->

So what is the IE 8 part for ie8 quirks?

Was it helpful?

Solution

You can't use conditional comments to target a browser's rendering mode (just versions).

If you are in quirks mode, use a doc type that doesn't invoke it.

Unless, you are referring to IE8's compatibility mode, which makes the browser render similar to IE7. In that case, use the following conditional comment...

<!--[if IE 7]>
    awesome hacky stuff goes here
<![endif]-->

OTHER TIPS

I don't think it's possible to test for quirks mode. Instead, use a DOCTYPE and make sure your HTML validates to it. XHTML DOCTYPEs are probably better.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top