日期:2014-05-17  浏览次数:20615 次

IE 6-7-8,ff.saf,Opera选择器大全(补充中--CSS Hack)
早上起来,就把IE,FF的识别标签整理一下,这是初步的,以后再补充。
IE6识别: _   *   与  +
IE7识别:* +  与!important
FF识别:!important
*和+是IE特有标签
总结:
    只区分出IE6,用_
    只区分出IE7,用*+或者* !important或者+!important
   
如下例1:{
              background:black;/***IE,FF均识别***/
              *background:green;/***排除掉FF***/
              *+background:blue;/***只剩下IE7***/
}
例2:{
              background:black;/***IE,FF均识别***/
              *background:green;/***排除掉FF***/
              *background:blue !important;/***只剩下IE7***/
}
例3:{
              background:black;/***IE,FF均识别***/
              *background:green;/***排除掉FF***/
              _background:blue;/***只剩下IE6***/
}
这里面设计到一个组合问题,顺序根据设计来变动,一般来考虑:采用递减形式的识别,从多到少 
    当然,对于IE自己也可以用它自身识别的语句来实现区分:
    Only IE 所有的IE可识别
    /*** 只有IE5.0可以识别 ***/
    Only IE 5.0+ /*** IE5.0与IE5.5都可以识别 ***/
    /*** 仅IE6可识别 ***/
    Only IE 6/+ /*** IE6与IE6以下的IE5.x都可识别 ***/
    Only IE 7/- /*** 仅IE7可识别 ***/
好,今天先到这里,以后接着整理。

继续补充下:[color=red][/color]


/* IE6 and below */
* html #uno  { color: red }

/* IE7 */
*:first-child+html #dos { color: red }

/* IE7, FF, Saf, Opera  */
html>body #tres { color: red }

/* IE8, FF, Saf, Opera (Everything but IE 6,7) */
html>/**/body #cuatro { color: red }

/* Opera 9.27 and below, safari 2 */
html:first-child #cinco { color: red }

/* Safari 2-3 */
html[xmlns*=""] body:last-child #seis { color: red }

/* safari 3+, chrome 1+, opera9+, ff 3.5+ */
body:nth-of-type(1) #siete { color: red }

/* safari 3+, chrome 1+, opera9+, ff 3.5+ */
body:first-of-type #ocho {  color: red }

/* saf3+, chrome1+ */
@media screen and (-webkit-min-device-pixel-ratio:0) {
       #diez  { color: red  }
}

/* iPhone / mobile webkit */
@media screen and (max-device-width: 480px) {
       #veintiseis { color: red  }
}

/* Safari 2 - 3.1 */
html[xmlns*=""]:root #trece  { color: red  }

/* Safari 2 - 3.1, Opera 9.25 */
*|html[xmlns*=""] #catorce { color: red  }

/* Everything but IE6-8 */
:root *> #quince { color: red  }

/* IE7 */
*+html #dieciocho {  color: red }

/* Firefox only. 1+ */
#veinticuatro,  x:-moz-any-link  { color: red }

/* Firefox 3.0+ */
#veinticinco,  x:-moz-any-link, x:default  { color: red  }