Forcing IE 11 to behave as IE 10

我怕爱的太早我们不能终老 提交于 2019-11-29 23:04:15
Marco Demaio

Do the following:

  1. The correct meta string is: <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10"/> (I added it just below the <title>. Preserve case, IE crappy code might be also case sensitive.)

  2. And a valid <!DOCTYPE... must be present at the very 1st line of your page (no space or lines before it)

You can verify if it works by hitting F12 to show the IE11 developer tools. On the left side there is a grey bar, scroll it down and select Emulation, if it shows Document mode: IE10 it will be fine!

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

Should work.

I know this will not set IE11 to IE10 mode but it might me worth a shot to try the edge setting.

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

This flow chart shows how the document mode works. The image is from the Microsoft MSDN site. http://msdn.microsoft.com/en-us/library/ff955275%28v=vs.85%29.aspx

Another useful link MSDN IE document modes http://msdn.microsoft.com/en-us/library/ff406036(v=vs.85).aspx

I just had the same problem. Its as if the x-ua-compatible tag does not change the document mode unless its the first meta tag in the header. I had a script tag above it.

If you put the meta tag you tried as the first tag in the header and press F12, you will see the document mode stays on 10.

This may help you to set response header with IIS: http://msdn.microsoft.com/en-us/library/ff955275(v=vs.85).aspx

Syed Mohamed

I also tried this, it doesn't works for me

<meta http-equiv="x-ua-compatible" content="IE=10">

also its works well if i manually change Useragentstring in F12 IE console to IE10,

I got a solution here below and its works for me, now my pages works properly in IE11 without changing anything in my code

Refer this https://stackoverflow.com/a/20422240/2089963

Setting in we.config:

<system.webServer>
    <httpProtocol>
        <customHeaders>
            <clear/>

            <add name="X-UA-Compatible" value="IE=EmulateIE9"/>
        </customHeaders>
    </httpProtocol>

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!