Force IE compatibility mode off using tags

后端 未结 12 1364
广开言路
广开言路 2020-11-22 07:56

I am doing work for a client who forces compatibility mode on all intranet sites. I was wondering if there is a tag I can put into my HTML that forces compatibility mode off

12条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 08:25

    IE8 defaults to standards mode for the intERnet and quirks mode for the intRAnet. The HTML meta tag is ignored if you have the doctype set to xhtml transitional. The solution is to add an HTTP header in code. This worked for us. Now our intranet site is forcing IE8 to render the app in standards mode.

    Added to PageInit of the base page class (ASP.net C#):

    Response.AddHeader("X-UA-Compatible", "IE=EmulateIE8");
    

    reference: http://ilia.ws/archives/196-IE8-X-UA-Compatible-Rant.html

提交回复
热议问题