0

How could you detect a browser is using ie quirks/compatibilty mode and then switch themes if detected?

I've developed a nice new "responsive" theme for wordpress. It works great on mobiles & in all the browsers I've tested - firefox, chrome, even ie 6, 7, 8 & 9.

The only issue arises when using the compatibility mode in internet explorer - the site becomes "unresponsive" (divs & images not scaling properly).

For the moment I have disabled the compatibiltiy view completely with:

<meta http-equiv="X-UA-Compatible" content="IE=Edge" > 

So a couple of questions:

  • Should I expect responsive themes to work properly in ie compatibility mode?

  • How can I change to a different theme if compatibilty mode is selected?

Thanks

1

If you're theme is working fine in IE 6, 7, 8 & 9 with compatibility mode disabled then you don't really need to have it enabled.

If you (try to) respect web standard, you can simply always use http-equiv="X-UA-Compatible" content="IE=edge". To keep compatibility with old browsers, just avoid using latest web features: use the subset supported by the oldest browser you want to support. Do not care about the best IE version rendering.

The positives sides of not having compatibility mode enabled has been discussed here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.