我收到錯誤:X-UA兼容META標籤('IE = 7')被忽略,因爲文檔模式已經完成。HTML X-UA兼容標籤在IE中不起作用9
我讀過這個問題的解決方法是元標記在頭標記中沒有被聲明爲足夠高,但是我試過將這個元標記移動到頭標記的第一行並且沒有修復錯誤。
我在Grails .gsp文件中工作,該文件也使用了敲除js。
下面是相關的代碼:
<!doctype html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"><!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>myInfinitec Membership Management</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="/ucpmanagementportal/static/images/favicon.ico" type="image/x-icon">
<meta name="layout" content="main"/>
<script src="/ucpmanagementportal/static/plugins/jquery-1.7.1/js/jquery/jquery-1.7.1.min.js" type="text/javascript" ></script>
<link href="/ucpmanagementportal/static/bundle-bundle_coreCSS_head.css" type="text/css" rel="stylesheet" media="screen, projection" />
</head>
編輯:在IE顯影劑窗口有每行之間產生「文本 - 空文本節點」行。也許這就是X-UA兼容元標記之前的東西。我讀到修復的方法是在受影響的元素上添加display:block和zoom:1,但這不起作用。以下是對我描述一個例子:
<head>
Text - Empty Text Node
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
Text - Empty Text Node
<meta style="display: block; zoom: 1;" http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
Text - Empty Text Node
您的x-ua兼容屬性設置爲邊緣? – StuartLC 2012-07-09 16:04:15
應該設置什麼呢? – 2012-07-09 16:06:45
如果我理解你的問題,你想要IE 7兼容性,那麼它會是IE = 7,鉻= 1。可能還有其他x-ua兼容的介紹嗎? – StuartLC 2012-07-09 16:56:39