简体   繁体   English

IE 8渲染怪癖模式

[英]IE 8 rendering quirks mode

I know this is a old problem, and there are alot of fixes for this. 我知道这是一个老问题,并且有很多修复方法。 I have applied the following, but still some of my users get the quirks mode. 我已经应用了以下内容,但仍有一些用户获得了怪癖模式。 And its only users that run IE 8. 它是唯一运行IE 8的用户。

<!doctype html>

and

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

It seems like this is not enough, the page is still rendering in quirksmode in IE 8. 看起来这还不够,页面仍然在IE 8中的quirksmode中呈现。

Since this is an umbraco/c# site, the first row in the source is empty. 由于这是一个umbraco / c#站点,因此源中的第一行是空的。 This is because of the Master directive in the top. 这是因为顶部的Master指令。 You cannot move above it. 你无法超越它。 See picture. 见图。

在此输入图像描述

This is some code from the site. 这是该网站的一些代码。

<!doctype html>

<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!-- Consider adding an manifest.appcache: h5bp.com/d/Offline -->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="sv">
<!--<![endif]-->
<head>
    <meta charset="utf-8">
    <!-- Use the .htaccess and remove these lines to avoid edge case issues.
       More info: h5bp.com/b/378 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

The source is like this. 来源是这样的。

<%@ Master Language="C#" AutoEventWireup="true" %>
<!doctype html>
<%@ Import Namespace="System.Web.Configuration" %>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!-- Consider adding an manifest.appcache: h5bp.com/d/Offline -->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="sv">

The "Master" creates the empty line in the top. “Master”在顶部创建空行。

Installing Google Chrome Frame fixes the problem, but due to citrix environments some of our users don't have the full control to install plugins. 安装Google Chrome Frame可以解决问题,但由于Citrix环境,我们的某些用户无法完全控制安装插件。

查看Henri Sivonen的页面使用Doctype激活浏览器模式,它还讨论了IE 8/9专业版和(尽管页面名称)也可能影响浏览器模式的doctype声明以外的其他因素。

Is the page on an intranet? 内联网上的页面是? I believe IE8 defaults to quirks mode in that case. 在这种情况下,我认为IE8默认为怪异模式。 You could set a group policy to get around this though. 您可以设置组策略以解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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