1

I have an intranet site built using ASP.NET that when rendered always displays in standards mode. When using the Developer Toolbar, my site works perfectly using 'IE8 - Quirks Mode'. When using Standards mode it does not appear properly.

I have seen a dozen posts about setting the app into Standards mode (like this one: Override intranet compatibility mode IE8) but these techniques make the browser go to Standards mode.

Does that mean Quirks is the default? If that's the case, my site is not rendering by default in Quirks but rather in Standards.

I also tried this as well and it to makes it in Standards mode:
<meta http-equiv="X-UA-Compatible" content="IE=8" />

What meta tag can I assign or other technice to ensure my site is always rendered in IE 8 - Quirks Mode?

Community
  • 1
  • 1
atconway
  • 18,827
  • 24
  • 140
  • 216
  • There's This answer: http://stackoverflow.com/questions/5123326/force-ie9-into-quirks-mode/ about *forcing* IE9 rendering a document in quirks mode, you might check this – Max Lambertini Sep 25 '13 at 15:21
  • I should have added that I did look at that link already. It was specific to using an `iFrame` and the solution did not work for me. In fact, the answer in that post is the one I posted and already tried. – atconway Sep 25 '13 at 15:44

2 Answers2

0

content="IE=8" will make it use IE 8 Standards. To use quirks as far as I'm aware change the doctype as such:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">"

Or leave it out entirely

Chris
  • 695
  • 5
  • 16
  • Hummm, this was close but ended up being `IE5 Quirks` mode which also looked bad. When I used the developer toolbar and made `IE8 Quirks` it looked good again. Anyway to modify this to make `IE8 Quirks`? – atconway Sep 25 '13 at 16:22
0

Firstly, the best thing you can do is try to drop the requirement for Quirks mode. It doesn't just change the page layout, it also switches off all of the modern browser features.

This will give you problems if you want to use any of these modern features. (note that quirks mode is an IE5-compatibility mode, so "modern features" means pretty much anything invented since IE5!). For this reason, I strongly recommend if at all possible that you consider switching the site so it works in Standards mode.

The main reason for using standards mode is to future-proof your code. IE's bad reputation is due to old versions and features like quirks mode, and in recent versions of IE, Microsoft are trying to move away from the past. I would not be surprised to see quirks mode disappear from the browser at some point in the future.

In addition, using standards mode will allow your site to work properly in all other browsers. In Quirks mode, your site will only ever work properly in IE.

The good news is that switching a site from quirks mode to standards mode is often a lot less work than it sounds. The main thing you need to know about is a CSS feature box-sixing. This allows you to use the quirks mode layout model while still keeping the site in standards mode.

Add the following to your CSS:

* {box-sizing:border-box;}

This shuold hopefully fix the majority of the layout issues that you're getting switching from quirks mode to standards mode, and should allow you to stay in standards mode.

The remainder of the layout issues are likely to be caused by bugs in IE5 that have been fixed in subsequent IE versions but left in quirks mode for compatibility reasons. You will probably need to fix these manually. But hopefully there won't be too many of them.



Okay, so if you're still reading, I'm going to assume that the above isn't good enough for you, and you really do want to stick to quirks mode.

Putting a site in quirks mode is fairly easy in IE: Just drop the DOCTYPE declaration.

When IE sees a site that doesn't have a doctype, it automatically assumes that it should render it in quirks mode.

As I say, I strongly recommend not doing this, but if you absolutely have to, that's how to do it.

Spudley
  • 157,081
  • 38
  • 222
  • 293
  • Funny thing is my site uses Twitter Bootstrap and is quite current, but I have some user's that want to use IE8 to pull it up. I have the following currently in my `CSS`: `*, *:before, *:after { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }` This is to help with accounting for spacing using Twitter Bootstrap layout. Is this suffice? – atconway Sep 25 '13 at 16:18
  • Bootstrap should support IE8 just fine in standards mode. There really should be no need to go anywhere near quirks mode. To be honest, given what you've just said it sounds like you're asking entirely the wrong question (and you probably already know most of what I said in the answer). What you should be asking is *why* your site isn't rendering nicely in IE8 and whether Bootstrap is anything to do with that. Does it work in other browsers? Other IE versions? Can you provide an example that demonstrates the problem? Maybe close this question down and start a fresh one with all that info. – Spudley Sep 25 '13 at 16:27
  • Sounds nice but I know what I'm seeing and what's solving it manually. This is an `intranet` site and will only be run in `IE`. When I select 'IE8 - Quirks` in the development toolbar; it works. I don't have the luxury of a ton of time to siphon through a ton of `CSS` (not my specialty) anyway and determine the 'why`. I just know I have a solution and need to try and get it to this programatically. Maybe in v2 I can spend more time trying to figure out the 'why'. Works great in IE9 and IE10. – atconway Sep 25 '13 at 17:56
  • my point was to ask the question here here on SO. It's very likely there's a simple one-hit answer. "its doing it because of X, quick fix, problem solved". But you need to ask the question or we'll never know. Or you could just stick it into quirks mode. Fair enough; I appreciate the point about lacking time. But do so with caution. I can tell you for certain that Bootstrap is not designed to work in quirks mode. If it works for you in this case, that's fine, but there will be stuff in Bootstrap that will break, and when it hits you, the only option you'll have will be standards mode. – Spudley Sep 25 '13 at 22:23