Force IE9 to emulate IE8. Possible?
You can use the document compatibility
mode to do this, which is what you
were trying.. However, thing to note
is: It must appear in the Web page's
header (the HEAD section) before all
other elements, except for the title
element and other meta elements Hope
that was the issue.. Also, The
X-UA-compatible header is not case
sensitive Refer:
http://msdn.microsoft.com/en-us/library/cc288325%28v=vs.85%29.aspx#SetMode
Edit: in case something happens to kill the msdn link, here is the content:
Specifying Document Compatibility Modes
You can use document modes to control the way Internet Explorer
interprets and displays your webpage. To specify a specific document
mode for your webpage, use the meta element to include an
X-UA-Compatible header in your webpage, as shown in the following
example.<html>
<head>
<!-- Enable IE9 Standards mode -->
<meta http-equiv="X-UA-Compatible" content="IE=9" >
<title>My webpage</title>
</head>
<body>
<p>Content goes here.</p>
</body>
</html>
If you view this webpage in Internet Explorer 9, it will be displayed
in IE9 mode.The following example specifies EmulateIE7 mode.
<html>
<head>
<!-- Mimic Internet Explorer 7 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
<title>My webpage</title>
</head>
<body>
<p>Content goes here.</p>
</body>
</html>
In this example, the X-UA-Compatible header directs Internet Explorer
to mimic the behavior of Internet Explorer 7 when determining how to
display the webpage. This means that Internet Explorer will use the
directive (or lack thereof) to choose the appropriate
document type. Because this page does not contain a
directive, the example would be displayed in IE5 (Quirks) mode.
How to force compatibility mode for all versions of IE?
Compatibility mode is meant to help users with old products that are not up-to-date. In no way it should help the developer to avoid the issues he may find.
Unless you absolutely have no choice (for example a broken dependency like SharePoint...) or want to expose a serious lack of competence, you should not force a user to see your page in compatibility mode.
If you need to support all IE versions, you must understand how each version works and be aware of each differences in order to make a code that can result in the same output no matter the version.
If the idea of mastering "crappy versions" (for example IE6 and older) sounds really bad to you, I would advise you to establish a threshold to concentrate on the compatibility with some old versions, rather than all of them.
EDIT: But if you really need to force compatibility mode, you can use the "X-UA-Compatible" meta tag. For example:
<meta http-equiv="X-UA-Compatible" content="IE=9" />
How to emulate IE8 environment?
You may install VirtualPC images with different IE versions for free from
this Microsoft provided page
Force Internet Explorer 8 browser mode in intranet
Seem that MSFT has not consider a large intranet environment that we have many different web application running inside.
There is no way to bypass the IE8 setting, according to somewhere I read on MSDN forum.
So, I will have to beg my system administrators to put some new group policies to change "Compatibility View" setting and the value and prevent user change the value, until MSFT discover this bug and fix it.
From an MSDN blog post (emphasis theirs): "Browser Mode is chosen before IE requests web content. This means that sites cannot choose a Browser Mode."
Force IE8 emulation in IE10 iframe
The "emulate" values tell IE to follow the default behavior; that is, to use the mode it would normally use based on the document type declaration (doctype).
Since you're using the HTML5 doctype, this would lead IE to choose edge mode, the latest and greatest mode available to that version of IE.
To restrict things to a specific mode, specify that in your content attribute value, e.g. content="ie=8"
Note that you may need to do this for both the parent and the child iframe. (There's a specific set of parsing rules in certain versions that allow you to mix standards modes, but that's even more confusing, so it's best to be consistent throughout.)
See Specifying legacy document modes for more info.
Hope this helps...
-- Lance
Tell IE9 to use compatibility mode?
The syntax for compatibility mode is:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" >
The content attribute specifies the mode for the page; to mimic the behavior of Internet Explorer 7, specify IE=EmulateIE7. Specify IE=5, IE=7, IE=8 or IE=9 to select one of those compatibility modes. You can also specify IE=edge to tell Internet Explorer to use the highest mode available.
Understanding Document Compatibility Modes
Internet Explorer supports a number of document compatibility modes that enable different features and can affect the way content is displayed:
- IE9 mode provides the highest support available for established and
emerging industry standards, including the HTML5 (Working Draft), W3C
Cascading Style Sheets Level 3 Specification (Working Draft),
Scalable Vector Graphics (SVG) 1.0 Specification, and others. - IE8 mode supports many established standards, including the W3C
Cascading Style Sheets Level 2.1 Specification and the W3C Selectors
API; it also provides limited support for the W3C Cascading Style
Sheets Level 3 Specification (Working Draft) and other emerging
standards. - IE7 mode renders content as if it were displayed in standards mode by
Internet Explorer 7, whether or not the page contains a<!DOCTYPE>
directive. - Emulate IE9 mode tells Internet Explorer to use the
<!DOCTYPE>
directive to determine how to render content. Standards mode
directives are displayed in IE9 mode and quirks mode directives are
displayed in IE5 mode. Unlike IE9 mode, Emulate IE9 mode respects the<!DOCTYPE>
directive. - Emulate IE8 mode tells Internet Explorer to use the
<!DOCTYPE>
directive to determine how to render content. Standards mode
directives are displayed in IE8 mode and quirks mode directives are
displayed in IE5 mode. Unlike IE8 mode, Emulate IE8 mode respects the<!DOCTYPE>
directive. - Emulate IE7 mode tells Internet Explorer to use the
<!DOCTYPE>
directive to determine how to render content. Standards mode
directives are displayed in Internet Explorer 7 standards mode and
quirks mode directives are displayed in IE5 mode. Unlike IE7 mode,
Emulate IE7 mode respects the<!DOCTYPE>
directive. For many web
sites, this is the preferred compatibility mode. - IE5 mode renders content as if it were displayed in quirks mode by
Internet Explorer 7, which is very similar to the way content was
displayed in Microsoft Internet Explorer 5. - Edge mode tells Internet Explorer to display content in the highest
mode available. With Internet Explorer 9, this is equivalent to IE9
mode. If a (hypothetical) future release of Internet Explorer
supported a higher compatibility mode, pages set to edge mode would
appear in the highest mode supported by that version. Those same
pages would still appear in IE9 mode when viewed with Internet
Explorer 9.
Because edge mode documents display webpages using the highest mode available to the version of Internet Explorer used to view them, it is recommended that you should only use this document mode for testing purposes only. Do not use it for production uses.
For more information on IE compatibility mode, check this out.
Force IE9 into Quirks mode?
I had your same issue and researched it fairly extensively back in April 2011. As of then, the only way to have a top-level document in "standards mode" and a document in a child iframe in "quirks mode" in IE9 was to use a meta tag to have the browser behave as if it were IE8. (As far as I know, this is still the case and Microsoft has no intention to change it.) There are a variety of meta tags you can use to change browser mode, but the one I have used that has worked was:
<meta http-equiv="X-UA-Compatible" content="IE=8" />
If you include this meta tag, all of the documents should be properly rendered (per IE8 rules) according to their doctype.
Note, however, that this precludes you from using any of the newly supported css features in IE9, even in the top-level document. You won't be able to use border-radius, box-shadow, opacity, etc..
There's some more info on this at Will an iframe render in quirks mode?, which asks a more general question about iframes and doctypes in ie.
Related Topics
Make Floating Divs The Same Height
How to Align a Label to The "Bottom" of a Div in CSS
The Right Way of Setting <A Href=""> When It's a Local File
Emulate Ie7 for Ie8 But Not for Ie9 Using "X-Ua-Compatible"
Hide Microdata Property Value in 'Content' Attribute
Vertically Align Div (No Tables)
CSS Not Loading After Redirect with Htaccess Rewrite Rule
"Attribute Name Not Allowed on Element Div at This Point"
Unordered List (<Ul>) Default Indent
Flexbox Layout with Two Equal Height Children, One Containing Nested Flexbox with Scrolling Content
CSS 100% Height with Absolute Positioning Top 0 Bottom 0
How Can Change Width of Dropdown List
How to Prefix Ordered List Item Numbers with a Static String Using CSS
Why Isn't Textarea an Input[Type="Textarea"]
Centering a Div Between One That's Floated Right and One That's Floated Left
How to Make a Youtube Embedded Video a Full Page Width One