IE9强制使用Quirks模式,我尝试了一些解决方案但没有成功
我尝试添加:<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
然而,这似乎并不能解决问题 - 即使它直接放在<head>
下面
这是我的代码的顶部:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--[if lt IE 7 ]> <html class="ie ie6 no-js" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="ie ie7 no-js" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="ie ie8 no-js" lang="en"> <![endif]-->
<!--[if IE 9 ]> <html class="ie ie9 no-js" lang="en"> <![endif]-->
<!--[if gt IE 9]><!-->
<html class="no-js" lang="en">
<!--<![endif]-->
<!-- the "no-js" class is for Modernizr. -->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>Availability</title>
<link href="<%= CommonHelper.GetApplicationLocation() %>portal.css" type="text/css"
rel="stylesheet" />
<LINK href="<%= CommonHelper.GetApplicationLocation() %>National.css" type="text/css" rel="stylesheet" />
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-10">
<link rel="shortcut icon" href="<%= CommonHelper.GetApplicationLocation() %>favicon.ico" />
<LINK href="<%= CommonHelper.GetApplicationLocation() %>css/new-styles.css" type="text/css" rel="stylesheet">
<LINK href="<%= CommonHelper.GetApplicationLocation() %>mobile.css" type="text/css" rel="stylesheet">
<meta charset="utf-8" />
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR" />
<meta content="C#" name="CODE_LANGUAGE" />
<meta content="JavaScript" name="vs_defaultClientScript" />
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name = "format-detection" content = "telephone=no" />
<meta name="google-site-verification" content="quYroxU0ZWi8YjEB9xL8j79VCAhHrSalFUnPFexYjxI" />
我在这里遗漏了什么吗?
谢谢
最佳答案
使用简单的<!doctype html>
HTML 文件顶部的声明。这是针对 HTML5 的,它很可能就是您正在寻找的内容。
关于html - IE9 强制怪异模式且找不到解决方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25405571/