工做中遇到的ie网站兼容性问题 头疼..........css
如下为从网上搜索学习的整理兼容性方法 用于本身记录html
#兼容问题html5
##css hack: https://blog.csdn.net/freshlover/article/details/12132801
##综合兼容方案:https://www.cnblogs.com/zamhown/p/6709932.html
##标签兼容:https://blog.csdn.net/qq_34543438/article/details/74517880
##文字溢出隐藏:http://www.jiangweishan.com/article/text-yichu-method.htmlweb
##meta标签兼容
(```)ajax
<meta http-equiv = "Content-Type" content="text/html";charset="utf-8"></metahttp-equiv> <meta http-equiv="X-UA-Compatible" content="chrome=1"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv=X-UA-Compatible content=IE=EmulateIE8> <meta http-equiv=X-UA-Compatible content=IE=EmulateIE8></metahttp-equiv> <meta http-equiv=X-UA-Compatible content=IE=EmulateIE7> <meta http-equiv=X-UA-Compatible content=IE=EmulateIE7></metahttp-equiv>
(```)chrome
##判断ie版本进入(条件注释方法)
(```)浏览器
<!--[if lte IE 9]> <script src="./lib/html5shiv/html5shiv.js"></script> <script src="./lib/selectivizr.js"></script> <![endif]--> <!--[if lte IE 8]> <script src="./lib/html5shiv/html5shiv.js"></script> <script src="./lib/selectivizr.js"></script> <style> .index-text{ top:30%; left:14%; } </style> <![endif]-->
(```)服务器
##百度兼容处理方法(网上搜的)
(```)
<script>varwpo={start:newDate*1,pid:109,page:'superpage'}</script>
(```)app
##伪元素兼容方法
(```)学习
div:first-child 第一个div div:first-child+div 第二个div
(```)
##媒体查询检测ie10 11 (ie10 11不支持条件注释方法)
(```)
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { /* IE10+ CSS styles go here */ } /*媒体查询检测ie10 11*/
(```)
##兼容圆角方法(未成功)
(```)
-webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; behavior: url(../lib/PIE.htc);
使用pie.htc须要注意如下几点: 1.添加pie.htc时路径是相对于当前html的而不是相对于css的,从图1示例代码能够看出。在此咱们能够使用根路径(/css/pie.htc),这样不用考虑html、css和pie.htc的相对位置。 2. 项目须要在服务器或者本地服务器上运行才有效果 。 3.给div添加阴影时必须给div加上背景,不然div内部也全是阴影。
(```)
##meta标签处理双核浏览器兼容
(```)
经过meta标签作内核兼容 经过这两个标签可以使国内浏览器默认使用极速模式浏览 <meta name="renderer" content="webkit|ie-stand|ie-comp" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> content的取值为webkit,ie-comp,ie-stand之一,区分大小写,分别表明用webkit内核,IE兼容内核,IE标准内核。
若页面需默认用极速核,增长标签:<meta name="renderer" content="webkit"> 若页面需默认用ie兼容内核,增长标签:<meta name="renderer" content="ie-comp"> 若页面需默认用ie标准内核,增长标签:<meta name="renderer" content="ie-stand">
同时也能够同时指定多个内核名称,之间以符号”|”进行分隔,以下代码: <meta name="renderer" content="webkit|ie-comp|ie-stand"> 360浏览器官方说明:http://se.360.cn/v6/help/meta.html QQ浏览器官方说明:http://browser.qq.com/wiki/index.html#!index.md
(```)
##视频兼容
html5media:https://html5media.info/
##jq下 ajax ie8 9下不起做用
https://blog.csdn.net/dulei_start/article/details/81220170
##最后一个快乐的方法 微笑又不失礼貌的提示用户浏览器版本太低请升级!
(```)
<div style="background: #eeeeee;border-bottom: 1px solid #cccccc;color: #000;padding: 15px;margin: 0;z-index: 9999;"> 您的浏览器<strong> 版本太低 不能体验更好的浏览效果</strong>, <a href="http://browsehappy.com/" style="color: #003bb3;font-weight: bold;" target="_blank"> 请升级您的浏览器 </a> 以得到更好的体验。 <a href="#" style="color: #FFFFFF;font-weight: bold;" onclick="this.parentNode.parentNode.removeChild(this.parentNode.style.display='none');">
点击关闭提示 </a> </div>
(```)