IE8, compatibility view on local files?

Erik picture Erik · Aug 25, 2009 · Viewed 9.2k times · Source

I just developed a small website and tested it locally in IE8, there is no compatibility view button but under settings i find an option called "display intranet sites in compatibility view", this option is checked so i trust that all local files are rendered as IE7.

I then upload the page to my server and everything works fine in IE8-mode, now the the comp-view button is visible, i click it and my design becomes fubar!

I go to the settings for comp-view and uncheck the "display intranet sites in compatibility view", the site still looks ok when i try to browse it directly from the hdd and there is still no comp-view button visible.

This time i managed to create a fix in my css quite easily but i don't want to experience this again for a larger website.

How can i get BOTH IE8-mode and compatibility view for local pages and can i trust that it is active or not?

Answer

scunliffe picture scunliffe · Aug 25, 2009

If you load files off your C:\ (e.g. that kind of local) then yes, you are forced into IE8 standards mode. In this case, the only way to toggle it is to use the Developer Tools F12 and toggle it there, by doing the following:

  1. Press F12 to access the Developer Tools. A new pane will appear at the bottom of the browser window
  2. On the left menu, scroll down to the final option (Emulation). Or, press Ctl+8
  3. Set the Document Mode to the desired browser version.

IE Developer Tools Example

If by local you mean off a webserver running on your PC or on a PC in your network (e.g. Intranet) then you can add it/them to the list of sites... they will then provide the icon on the address bar to toggle it.

I presume based on your description that you are seeing significant changes thus I presume you have set a DOCTYPE. Can you verify this for us?