首页 > 设计 > WEB开发 > 正文

兼容性小结

2019-11-02 18:26:42
字体:
来源:转载
供稿:网友

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    <meta name="renderer" content="webkit" />    <meta content="always" name="referrer" />    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />

1.不同浏览器的标签默认的外补丁和内补丁不同。解决:*{margin:0;padding:0;}2.chorme浏览器下字体最小12px解决:font-size:12px;   -webkit-transform-origin-x: 0;   -webkit-transform: scale(0.5833333333333334);scale=?/12;3.Ie浏览器中height和line-height必须成对写。4.ie6是有双倍的margin和padding.

解决:增加display:inline;写在float和margin一起。5.jquery中Trim()方法在ie8下失效不兼容,trim()是针对string类型的。解决:使用这个函数最好使用$.trim()或:(1) 去掉字符串前后所有空格function trim(str){       return str.replace(/(^/s*)|(/s*$)/g, "");}(2)//去除空格,包括前后,中间(包括中间空格,需要设置第2个参数为:g)function Trim(str, is_global) {       var result;       result = str.replace(/(^/s+)|(/s+$)/g, "");       if (is_global.toLowerCase() == "g") {       result = result.replace(//s/g, "");}return result;}6. 使用bootstrap中的 模态框要调用respond.js,这个js要在bootstrap.js之后引用。

7.在360等浏览器有时候说鼠标放上去或出现滚动条,在最外面增加overflow-x:hidden;

8.使用 setTimeout注意清空,传参数时要这样写setTimeout(function(){Inde("a","c")},10000)


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表