简体   繁体   中英

IE11 switching to Document Mode: IE7 Standards

IE11 switching to Document Mode: IE7 Standards Use

  1. <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  2. Tools > Compatibility View settings.

but not take effect. How to force document mode IE=11 / IE=Edge with programmatically at Client 3? 在此处输入图片说明

Do you have a .htaccess file? I always use the htaccess solution for this.

Not my answer, if you can use htaccess. See: Force IE8 *not* to use Compatibility View

anwser is beneath this line, from that post


You can also set the X-UA-Compatible header in Apache, via the config or an .htaccess file using the code below. Credit goes to html5boilerplate.com

# ----------------------------------------------------------------------
# Better website experience for IE users
# ----------------------------------------------------------------------

# Force the latest IE version, in various cases when it may fall back to IE7 mode
# github.com/rails/rails/commit/123eb25#commitcomment-118920
# Use ChromeFrame if it's installed for a better experience for the poor IE folk

<IfModule mod_setenvif.c>
  <IfModule mod_headers.c>
    BrowserMatch MSIE ie
    Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
  </IfModule>
</IfModule>

<IfModule mod_headers.c>
#
# Because X-UA-Compatible isn't sent to non-IE (to save header bytes), we need to inform proxies that content changes based on UA
#
  Header append Vary User-Agent
# Cache control is set only if mod_headers is enabled, so that's unncessary to declare
</IfModule>

you can try to use one of the following meta tags:

<meta http-equiv="x-ua-compatible" content="IE=EmulateIE9" >
<meta http-equiv="x-ua-compatible" content="IE=EmulateIE8" >
<meta http-equiv="x-ua-compatible" content="IE=EmulateIE7" >

and/or

<meta http-equiv="x-ua-compatible" content="IE=9" >
<meta http-equiv="x-ua-compatible" content="IE=8" >
<meta http-equiv="x-ua-compatible" content="IE=7" >

Or check this MSDN article

It is very likely your doctype is incorrect. Once this will be fixed/added it should take the latest one by default

Use something like this ie use meta tag outside head and just below doctype:-

<!DOCTYPE html>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>@HttpContext.Current.Cache["application_title"].ToString()</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />

    <meta name="viewport" content="width=device-width" />
</head>
<body>
...
</body>
</html>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM