关于<meta>的各种用处以及移动端的常见问题

1.优先使用最新版本的IE和Chrome

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

2.关闭IOS键盘首字母自动大写

<input type="text" autocapitalize="off" />

3.移动端取消touch高亮效果

html {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

4.禁止保存或拷贝图片

img { 
    -webkit-touch-callout: none; 
}

5.移动端适配js

<script src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/??flexible_css.js,flexible.js"></script>

 6.IOS下input有阴影

input,
textarea {
    border: 0; /* 方法1 */
    -webkit-appearance: none; /* 方法2 */
}

 7.双核浏览器默认以其内核渲染

<meta name="renderer" content="webkit">//默认webkit内核

<meta name="renderer" content="ie-comp">//默认IE兼容模式

<meta name="renderer" content="ie-stand">//默认IE标准模式

//例如360极速浏览器,因为国内IE浏览器盛行,一些银行系统只能用IE浏览器运行,在双核浏览器下就可以指定renderer属性默认以其内核渲染

 

posted on 2017-05-11 15:26  薛伟杰  阅读(202)  评论(0编辑  收藏  举报

导航