IE瀏覽器中文檔模式Quirks Model改為IE標(biāo)準(zhǔn)模式
IE文檔模式默認(rèn)為Quirks Model的代碼:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/common.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
</head>
<body>
</body>
</html>
上述代碼導(dǎo)致部分頁面布局凌亂,改為以下代碼:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/common.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
</head>
<body>
</body>
</html>
其中關(guān)鍵代碼為:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
在解決問題過程中個(gè),最開始只添加了:
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
但問題依然還存在,改變DTD申明后,問題解決。
想了解更多?現(xiàn)在就開始免費(fèi)體驗(yàn)