Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 为什么网页以IE8浏览器模式和IE7文档模式显示?_Html_Doctype_Ie8 Browser Mode - Fatal编程技术网

Html 为什么网页以IE8浏览器模式和IE7文档模式显示?

Html 为什么网页以IE8浏览器模式和IE7文档模式显示?,html,doctype,ie8-browser-mode,Html,Doctype,Ie8 Browser Mode,不知什么原因,我工作的网站保持了浏览器和文档模式的交叉匹配。当我打开IE8开发工具时,我看到浏览器模式是IE8,而文档模式是IE7 我已经做了几次doctype更改,但无法让站点在浏览器模式下自动加载文档模式,也就是IE8 当前Doctype声明: <%@ Page Language="vb" AutoEventWireup="true" Src="Scripts/Splash.aspx.vb" Inherits="SplashFunctionality"%> <!DOCTY

不知什么原因,我工作的网站保持了浏览器和文档模式的交叉匹配。当我打开IE8开发工具时,我看到浏览器模式是IE8,而文档模式是IE7

我已经做了几次doctype更改,但无法让站点在浏览器模式下自动加载文档模式,也就是IE8

当前Doctype声明:

<%@ Page Language="vb" AutoEventWireup="true"  Src="Scripts/Splash.aspx.vb" Inherits="SplashFunctionality"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Welcome to CAE's KC-135 ATS Home</title>
<link rel="stylesheet" type="text/css" href="CSS/HomeStyles.css"/>
<link rel="stylesheet" type="text/css" href="CSS/headerStyles.css"/>
<script type="text/javascript" src="Scripts/Roladex.js"></script>
<script type="text/javascript" src="Scripts/HeaderNav.js"></script>
<script type="text/javascript" src="Scripts/HomeFunctionality.js"></script>
<script type="text/javascript" src="Scripts/JSTweener.js"></script>
</head>
<body>

欢迎来到CAE的KC-135 ATS主页

要强制IE使用浏览器上的最新可用设置,如果使用Apache,可以将其添加到.htaccess中:

# ----------------------------------------------------------------------
# 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_headers.c>
  Header set X-UA-Compatible "IE=Edge,chrome=1"
  # mod_headers can't match by content-type, but we don't want to send this header on *everything*...
  <FilesMatch "\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|oex|xpi|safariextz|vcf)$" >
    Header unset X-UA-Compatible
  </FilesMatch>
</IfModule>
#----------------------------------------------------------------------
#为IE用户提供更好的网站体验
# ----------------------------------------------------------------------
#强制使用最新的IE版本,在各种情况下可能会退回到IE7模式
#github.com/rails/rails/commit/123eb25#commitcomment-118920
#如果安装ChromeFrame是为了给穷人带来更好的体验,请使用它
标题集X-UA-兼容“IE=Edge,chrome=1”
#mod_标题无法按内容类型匹配,但我们不希望在*everything*…上发送此标题。。。
标题未设置X-UA-Compatible
可以找到更多信息(如上所述)

您还可以将其添加为常规元标记:

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

如果不使用apache

另外,我建议使用html5 doctype:

<!doctype html>

要强制IE使用浏览器上的最新可用设置,如果使用Apache,可以将其添加到.htaccess中:

# ----------------------------------------------------------------------
# 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_headers.c>
  Header set X-UA-Compatible "IE=Edge,chrome=1"
  # mod_headers can't match by content-type, but we don't want to send this header on *everything*...
  <FilesMatch "\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|oex|xpi|safariextz|vcf)$" >
    Header unset X-UA-Compatible
  </FilesMatch>
</IfModule>
#----------------------------------------------------------------------
#为IE用户提供更好的网站体验
# ----------------------------------------------------------------------
#强制使用最新的IE版本,在各种情况下可能会退回到IE7模式
#github.com/rails/rails/commit/123eb25#commitcomment-118920
#如果安装ChromeFrame是为了给穷人带来更好的体验,请使用它
标题集X-UA-兼容“IE=Edge,chrome=1”
#mod_标题无法按内容类型匹配,但我们不希望在*everything*…上发送此标题。。。
标题未设置X-UA-Compatible
可以找到更多信息(如上所述)

您还可以将其添加为常规元标记:

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

如果不使用apache

另外,我建议使用html5 doctype:

<!doctype html>

发生这种情况的原因通常是由于IE中的配置设置,它告诉IE在某些条件下切换到兼容模式。当您在本地网络中浏览一个站点时,通常会发生这种情况——因此,当您测试正在开发的站点时,通常会发生这种情况

当然,您可以通过更改配置来关闭它。但是用户仍然可以打开该设置,因此您需要尝试在站点中处理它

实现这一点的方法是设置
X-UA-Compatible
meta标志,您可以使用该标志强制IE进入正确的模式

在大多数情况下,最佳设置如下:

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

将其添加到代码顶部的
块中


希望能有所帮助。

发生这种情况的原因通常是由于IE中的配置设置,它告诉IE在某些条件下切换到兼容模式。当您在本地网络中浏览一个站点时,通常会发生这种情况——因此,当您测试正在开发的站点时,通常会发生这种情况

当然,您可以通过更改配置来关闭它。但是用户仍然可以打开该设置,因此您需要尝试在站点中处理它

实现这一点的方法是设置
X-UA-Compatible
meta标志,您可以使用该标志强制IE进入正确的模式

在大多数情况下,最佳设置如下:

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

将其添加到代码顶部的
块中

希望有帮助