Forcing IE browsers to behave properly??

You can explicitly tell IE browsers to use its latest available rendering engine using a meta tag. This also prevents IE to open Quirks mode while rending page. You need to add below meta tag at page level to accomplish this.

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

In above meta tag,

  • IE=edge tells IE to use its latest rendering engine.
  • chrome=1 part tells it to use the Chrome rendering engine if it’s installed on the client computer, which basically brings Chrome rendering power to IE.

Alternatively, same could be done at server level as well.
For Apache web server, you can send the X-UA-Compatible headers by editing your httpd.conf file (shown below):

<Location /mypath>
    Header set X-UA-Compatible "IE=edge,chrome=1"

For IIS 7+, you can add custom header setting in your web.config file as shown below:

    <!-- ... -->

           <add name="X-UA-Compatible" value="IE=edge,chrome=1" />

    <!-- ... -->

For IIS 5/6, same can be achieved by adding the custom HTTP Header (as key-value pair) through IIS Manager (inetmgr –> HTTP Headers tab).


(Visited 275 times, 2 visits today)