浏览器兼容问题
2016-03-18 23:13
393 查看
问题:静态网页写的好好的,在浏览器下看都不变形,但是把它转换成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">
以上加红的比较重要
解决:原先的网页在谷歌,火狐,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">
以上加红的比较重要
相关文章推荐
- loadrunner--27987
- 1003 阶乘后面0的数量
- 解决移动硬盘在电脑上不能读写的问题
- Visual Studio“命名空间不存在***”的问题
- 基于Centos6.X系列的LNMP环境搭建
- 程序员求职面试心经40条
- 利用US-100超声波传感器测距的核心代码
- ibatis自动生成工具,abator使用方法
- 结对编程体会
- dom4j学习
- tomcat datasource
- iOS面向对象的建模:MVC(OC基础)
- finally会执行吗
- AlarmManager系统闹钟
- remove duplicates from sorted list
- BZOJ_P3172 [Tjoi2013]单词(AC自动机)
- JAVA面向对象之多态性
- jq 实现文字定时向上滚动效果
- BZOJ3764 : Petya的序列
- Android Broadcast------详解广播机制