浏览器hack详细介绍

发布于:
Script

IE系列浏览器的hack大略如下:

_nowamagic:1px;-----------ie6
*nowamagic:1px;-----------ie7
nowamagic:1px;----------ie89
nowamagic:1px9;--------ie9
:root nowamagic:1px;    ----ie9(实际情况可能ie9还是有问题,再用这种方式)

 

1.‘9’:

.test { color/***/: blue9 }
.header {width:300px;} /* 所有浏览器*/
.header {width/***/:330px\9;} /* 所有浏览器IE浏览器 */
.header {*width:310px;} /* IE7和IE6能识别,IE8和FF不能识别*/
.header {_width:290px;} /* IE6能识别,IE7、IE8和FF不能识别*/

条件注释判断兼容浏览器版本CSS HACK

发布于:
Script
<!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]-->
<!--[if IE]> 所有的IE可识别 <![endif]-->
<!--[if IE 6]> 仅IE6可识别 <![endif]-->
<!--[if lt IE 6]> IE6以及IE6以下版本可识别 <![endif]-->
<!--[if gte IE 6]> IE6以及IE6以上版本可识别 <![endif]-->
<!--[if IE 7]> 仅IE7可识别 <![endif]-->
<!--[if lt IE 7]> IE7以及IE7以下版本可识别 <![endif]-->
<!--[if gte IE 7]> IE7以及IE7以上版本可识别 <![endif]-->
<!--[if IE 8]> 仅IE8可识别 <![endif]-->
<!--[if IE 9]> 仅IE9可识别 <![endif]-->

<!–[if lt IE 9]>
加载CSS1
<!–[else]>
加载CSS2
<![endif]–>