一、使用高版本渲染模式css
<meta http-equiv=」X-UA-Compatible」 content=」IE=edge,chrome=1″/>
二、css hackchrome
(1)條件註釋bootstrap
<!--[if IE 6]>coding...<![endif]--> //ie6 <!--[if lte IE 9]>coding...<![endif]--> //小於等於ie9
(2)屬性前綴瀏覽器
_background-color:#000; //ie6
*background-color:#000; //ie6 ie7
等等
(3)ie filterapp
如:ui
opacity: .5; /* IE 4-9 */ filter:alpha(opacity=50);
三、兼容性插件spa
//如下代碼 放在頁面中或js文件中 均可以
(function(w){if(!("WebSocket"in w&&2===w.WebSocket.CLOSING)){var d=document.createElement("div");d.className="browsehappy";d.innerHTML='<div style="width:100%;height:100px;font-size:20px;line-height:100px;text-align:center;background-color:#E90D24;color:#fff;margin-bottom:40px;">\u4f60\u7684\u6d4f\u89c8\u5668\u5b9e\u5728<strong>\u592a\u592a\u65e7\u4e86</strong>\uff0c\u592a\u592a\u65e7\u4e86 <a target="_blank" href="http://browsehappy.osfipin.com/" style="background-color:#31b0d5;border-color: #269abc;text-decoration: none;padding: 6px 12px;background-image: none;border: 1px solid transparent;border-radius: 4px;color:#FFEB3B;">\u7acb\u5373\u5347\u7ea7</a></div>';var f=function(){var s=document.getElementsByTagName("body")[0];if("undefined"==typeof(s)){setTimeout(f,10)}else{s.insertBefore(d,s.firstChild)}};f()}}(window));
(2)直接跳轉插件
//放在頁面中或js文件中 均可以
(function(w){if(!("WebSocket"in w&&2===w.WebSocket.CLOSING)){w.location.replace("http://browsehappy.osfipin.com/");}}(window));