問題:靜態網頁寫的好好的,在瀏覽器下看都不變形,但是把它轉換成jsp放在服務器就變形了,用localhost訪問變形(可能是css沒加載上),而用127.0.0.1就不變形了
解決:原先的網頁在谷歌,火狐,IE11上都不變形,但是到360瀏覽器上就出現以上問題
後來發現是瀏覽器解析不一樣。在jsp頁面加一個meta就可以了。
原來的jsp:
<html>
<head>
<base href="<%=basePath%>">
<title></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
改過以後的:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<base href="<%=basePath%>">
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
以上加紅的比較重要