How to make Internet Explorer display in standard mode and NOT in Quirks?

I am coding Frontend, which works well in IE7 standard mode and IE8 mode.

When I launch Internet Explorer and load the page, IE7 and IE8 go into Quirks mode. How to force IE7 and IE8 to always load a page in standard mode?

I do not have special meta tags added so far.

Thanks for helping me.

Edit: my doctype and head look like this:

<!DOCTYPE html> <html lang="de"> <head> <title>...</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta charset="utf-8" /> <script src="js/html5.js"></script> (...) </head> 
+68
internet-explorer internet-explorer-8 internet-explorer-7 x-ua-compatible quirks-mode
Mar 21 '11 at 5:19
source share
6 answers

This is the way to be absolutely specific:

 <!doctype html> <!-- html5 --> <html lang="en"> <!-- lang="xx" is allowed, but NO xmlns="http://www.w3.org/1999/xhtml", lang:xml="", and so on --> <head> <meta http-equiv="x-ua-compatible" content="IE=Edge"/> <!-- as the **very** first line just after head--> .. </head> 

Cause:
Whenever IE encounters all conflicts, it reverts to the "IE 7 standard", ignoring x-ua-compatible .

(I know this is the answer to a very old question, but I struggled with it myself, and the above diagram is the correct answer. It all works every time)

+82
Nov 22 '12 at 20:13
source share

Unfortunately, they want us to use the tag so that their browser knows what to do. Check out this documentation that says we use:

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

and he must do.

+33
Mar 21 '11 at 5:22
source share
  • Using html5 doctype at the top of the page.

    <!DOCTYPE html>

  • Force IE to use the latest rendering mode

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

  • If your target browser is ie8, check compatible settings in IE8

I will talk about it in detail

+11
Sep 14 '12 at 9:13
source share

Adding the correct doctype declaration and avoiding the XML prolog should be sufficient to avoid the quirks mode .

+10
Mar 21 '11 at 5:27
source share

I know that this question was asked more than 2 years ago, but so far no one has mentioned it.

The best way is to use the http header

Adding a meta tag to the head does not always work, because IE could determine the mode before reading it. The best way to make sure IE always uses standards mode is to use a custom http header.

Title:

 name: X-UA-Compatible value: IE=edge 

For example, in a .NET application, you can put this in a web.config file.

 <system.webServer> <httpProtocol> <customHeaders> <add name="X-UA-Compatible" value="IE=edge" /> </customHeaders> </httpProtocol> </system.webServer> 
+9
Jun 23 '13 at 7:48
source share

It is possible that Doctype HTML5 is causing problems with these older browsers. It could also be funky related to HTML5 shiv.

You can try switching to one of the XHTML doctrines and changing your markup accordingly, at least temporarily. This may allow you to reduce the problem.

Does your design break down when these IEs switch to quirks mode? If this is your CSS causing things to display in a weird way, it might be worth working on CSS, so the site looks the same even when browser modes are switched.

+2
Mar 22 '11 at 18:18
source share



All Articles