关于浏览器兼容问题——还有移动端meta问题
<!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">
<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浏览器。
最新文章
- android FragmentActivity+FragmentTabHost+Fragment框架布局
- 解决Pyqt打包后运行报错:应用程序无法启动 因为程序的并行配置不正确
- java普通servlet三层开发模式图
- PAT乙级真题1006. 换个格式输出整数 (15)(解题)
- [AngularJS] Using AngularJS interceptors with $http
- ASP.NET MVC5 学习笔记-2 Razor
- http协议中:GET/POST/PUT/DELETE/TRACE/OPTIONS/HEAD方法
- 2017-07-07(zip unzip gzip gunzip)
- 从一道Python面试题说起(大神勿入)
- bzoj 2653 middle 二分答案 主席树判定
- 前段基础之CSS
- linux 命令之top
- JaxbUtil转json转XML工具类
- KeyPress键盘按键ASCII值对应表
- codeforces 853b//Jury Meeting// Codeforces Round #433 (Div. 1)
- UNITY录制视屏解决方案 - ShareREC For Unity3D
- Office 365 E3功能
- CentOS6.8 4.4.43内核 安装PF_RING
- spark 稠密向量和稀疏向量
- Why do you need a new Launch X431 scan tool?
热门文章
- 【angularjs】使用angular搭建项目,实现隔行换色
- Python学习笔记(3)-字符串
- 初学Python——线程
- keepalived+lvs子网掩码造成VIP切换故障 + vrrp_script+track_script
- C#总结(五)调用C++动态库(类型对照)
- DAG也许是真正的区块链3.0
- 跨域访问-需要设置HTTP响应标头
- Webpack+Typescript 简易配置
- 解决Android Studio 错误方法
- Node+GitLab实现小程序CI系统