<!DOCTYPE html>
<!--[if lt IE 7]> <html dir="ltr" lang="en-US" class="ie6"> <![endif]-->
<!--[if IE 7]> <html dir="ltr" lang="en-US" class="ie7"> <![endif]-->
<!--[if IE 8]> <html dir="ltr" lang="en-US" class="ie8"> <![endif]-->
<!--[if gt IE 8]><!--> <html dir="ltr" lang="en-US"> <!--<![endif]-->
<!-- BEGIN head -->

<head>

总之,就是在<!DOCTYPE html>与<head>中间的东西加入
<!--[if lt IE 7]> <html dir="ltr" lang="en-US" class="ie6"> <![endif]-->
<!--[if IE 7]> <html dir="ltr" lang="en-US" class="ie7"> <![endif]-->
<!--[if IE 8]> <html dir="ltr" lang="en-US" class="ie8"> <![endif]-->
<!--[if gt IE 8]><!--> <html dir="ltr" lang="en-US"> <!--<![endif]-->
这一大串就OK了,感觉自己棒棒哒~当然可能部分地方还需要修改

还有就是让网页适应移动端加个meta标签:

a、<!-- 强制让文档与设备的宽度保持1:1 -->
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">

禁止Html5在手机上屏幕页面缩放

<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />

网页宽度默认等于屏幕宽度(width=device-width),
初始缩放比例(initial-scale=1)为1.0,即网页初始大小占屏幕面积的100%。

b、<!-- 删除默认的苹果工具栏和菜单栏 -->
<meta name="apple-mobile-web-app-capable" content="yes">

c、<!-- 在web app应用下状态条(屏幕顶部条)的颜色 -->
<meta name="apple-mobile-web-app-status-bar-style" content="black" />

d、<!-- 禁止了把数字转化为拨号链接 -->
<meta name="format-detection" content="telephone=no">
e、<!-- 浏览网站时的小图标 -->
<link rel="shortcut icon" href="http://p.www.xiaomi.com/favicon.ico" type="/image/x-icon">

f、<!-- 添加至主屏时的图片 -->
<link rel="apple-touch-icon-precomposed" href="http://a.tbcdn.cn/mw/s/hi/tbtouch/images/touch-icon.png">

==================
还有一种有趣的方法
创建html5时发现这么一句话,如下:
<meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″/>

这样写可以达到的效果是如果安装了GCF(Google Chrome Frame 谷歌内嵌浏览器框架的简称),则使用GCF来渲染页面,如果没安装GCF,则使用最高版本的IE内核进行渲染。这个插件可以让用户的IE浏览器外不变,但用户在浏览网页时,实际上使用的是Google Chrome浏览器内核,而且支持IE6、7、8等多个版本的IE浏览器。

最新文章

  1. android FragmentActivity+FragmentTabHost+Fragment框架布局
  2. 解决Pyqt打包后运行报错:应用程序无法启动 因为程序的并行配置不正确
  3. java普通servlet三层开发模式图
  4. PAT乙级真题1006. 换个格式输出整数 (15)(解题)
  5. [AngularJS] Using AngularJS interceptors with $http
  6. ASP.NET MVC5 学习笔记-2 Razor
  7. http协议中:GET/POST/PUT/DELETE/TRACE/OPTIONS/HEAD方法
  8. 2017-07-07(zip unzip gzip gunzip)
  9. 从一道Python面试题说起(大神勿入)
  10. bzoj 2653 middle 二分答案 主席树判定
  11. 前段基础之CSS
  12. linux 命令之top
  13. JaxbUtil转json转XML工具类
  14. KeyPress键盘按键ASCII值对应表
  15. codeforces 853b//Jury Meeting// Codeforces Round #433 (Div. 1)
  16. UNITY录制视屏解决方案 - ShareREC For Unity3D
  17. Office 365 E3功能
  18. CentOS6.8 4.4.43内核 安装PF_RING
  19. spark 稠密向量和稀疏向量
  20. Why do you need a new Launch X431 scan tool?

热门文章

  1. 【angularjs】使用angular搭建项目,实现隔行换色
  2. Python学习笔记(3)-字符串
  3. 初学Python——线程
  4. keepalived+lvs子网掩码造成VIP切换故障 + vrrp_script+track_script
  5. C#总结(五)调用C++动态库(类型对照)
  6. DAG也许是真正的区块链3.0
  7. 跨域访问-需要设置HTTP响应标头
  8. Webpack+Typescript 简易配置
  9. 解决Android Studio 错误方法
  10. Node+GitLab实现小程序CI系统