2

I am designing an HTML website within a company website and I am having serious pain with IE 8 which enters Quirks Mode. I am using several CSS and Javascripts to format the HTML.

I have Googled for solutions to move from Quirks Mode into Internet Explorer 8 standards mode, which involved adding the following lines:

  1. <!DOCTYPE html> at the beginning of my html
  2. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> in the <head> tag.

However, since my HTML is embedded within the company HTML, and the company HTML begins with this line:

<HTML xmlns:o="urn:schemas-microsoft-com:office:office" dir="ltr">

Internet Explorer automatically launches into Quirks Mode and rearranges all my formatting despite the previous solutions that I have used.

And since I do not have any access/control over the company HTML, I am unable to add the <!DOCTYPE html> to the beginning of the company HTML.

For my circumstance, is there anything that I can do to force IE8 to not load the Quirks Mode? I have thought of writing a C# program that will force reload IE8 into standard mode, but I am unsure if it will be efficient.

Paul D. Waite
  • 93,468
  • 54
  • 192
  • 264
Shing Zhao
  • 39
  • 1
  • 6

1 Answers1

3

If you wrap your document in an iframe it should render that page with the declared doctype

You can even link straight to your own page :D

<iframe src="http://mycompany.com/mypage.html"></iframe> 
RyanS
  • 3,715
  • 3
  • 22
  • 36
  • 1
    Which standard suggests this behavior? As far as I know, a document in the iframe is almost completely independent from the host page, and is displayed in its own mode. Only IE9 and IE10 have the special mode for the page with quirks doctype in the iframe on the page with standard mode doctype, but even this mode is actually something in between the standards mode and the quirks mode (the broken CSS values are not ignored, but some newer JS features work and document.documentMode is reported to be equal to IE version). – Ilya Streltsyn Jul 17 '13 at 17:10
  • @IlyaStreltsyn Not sure what you're asking exactly, I dont have any official source, just a hunch ;) – RyanS Jul 17 '13 at 17:12
  • 1
    My test for the page with quirks mode doctype in the iframe on a standard page is here: http://selenit.freeoda.com/IE9/host.htm (red color of blocks means that the page is in Quirks mode or something like it). According to this test, I have to say that your hunch was not right:( – Ilya Streltsyn Jul 17 '13 at 17:14
  • Found the following question: http://stackoverflow.com/questions/3717932/will-an-iframe-render-in-quirks-mode. According to the answers, in IE8 and below "the webpage within the iframe would render according to its own doctype, not according to the doctype of the parent container", but since IE9 the quirks page in the iframe on a standard page is rendered in something called "Quirks mode emulation" within the newest engine. – Ilya Streltsyn Jul 17 '13 at 17:22
  • @IlyaStreltsyn Darn, good to know I guess. Lucky for the OP that they only wanted IE 8 then I suppose :p – RyanS Jul 19 '13 at 19:33