史上最適用的最直觀的CSS Hack參考手冊

2021-05-26 14:38:38 字數 2738 閱讀 3075

把下面的**儲存為html, 然後在不同的瀏覽器中開啟, 則css hack一目了然. 試一下你就知道了.

當然可能大師在總結這個列表的時候,一些瀏覽器還沒有出來,比如ie9, chrome12等等, 所以部分結論可能對這些最新的瀏覽器不成立。

如圖是我在ff下的觀測結果:

red if* html

matches in this browser. [ie6 and below ]

red if*:first-child+htmlmatches in this browser. [ie7]

red ifhtml>bodymatches in this browser [ie7, ff. saf, opera]

red ifhtml>/**/bodymatches in this browser. [ie8, ff, saf, opera (everything but ie 6,7)]

red ifhtml:first-childmatches in this browser. [opera 9.27 and below, safari 2]

red ifhtml[xmlns*=""] body:last-childmatches in this browser. [safari 2-3]

red ifbody:nth-of-type(1)matches in this browser. [safari 3+, chrome 1+, opera9+, ff 3.5+]

red ifdiv:nth-of-type(1n)matches in this browser. [safari 3+, chrome 1+, opera9+, ff 3.5+]

red ifbody:first-of-typematches in this browser. [safari 3+, chrome 1+, opera9+, ff 3.5+]

red if@media screen and (-webkit-min-device-pixel-ratio:0)matches in this browser. [saf3+, chrome1+ ]

red ifhtml[xmlns*=""]:rootmatches in this browser. [safari 2 - 3.1]

red if*|html[xmlns*=""]matches in this browser. [safari 2 - 3.1, opera 9.25]

red if:root *>matches in this browser. [everything but ie6-8]

red if*+htmlmatches in this browser. [ie7]

red if* >matches in this browser. [opera 9+, chrome2+, saf4+, ff3.5+]

red ifhtml:only-childmatches in this browser. [opera 9+, chrome2+, saf4+, ff3.0+, assumes attribute/value on html tag]

red if@media all and (min-width: 0px)matches in this browser. [opera 9+, chrome2+, saf4+, ff3.5+]

red ifhtml:lang(en)>bodymatches in this browser. [firefox only. 1+]

red ifbody:nth-of-type(1)matches in this browser. [firefox 3.0+]

red ifx:-moz-any-linkmatches in this browser. [unknown ---hides from ie6---]

red ifx:-moz-any-link, x:defaultmatches in this browser. [unknown]

blue ifdivmatches in this browser. [ie6]

blue ifdivmatches in this browser. [ie6, ie7]

blue ifdivmatches in this browser. [ie6, ie7]

blue ifdivmatches in this browser. [everything but ie6]

blue ifdivmatches in this browser. [ie6, ie7, ie8]

blue ifdivmatches in this browser. [ie7, ie8]

blue ifdivmatches in this browser. [ie6, ie7 -- acts as an !important, string after ! can be anything]

史上最適用的最直觀的CSS Hack參考手冊

把下面的 儲存為html,然後在不同的瀏覽器中開啟,則css hack一目了然.試一下你就知道了.當然可能大師在總結這個列表的時候,一些瀏覽器還沒有出來,比如ie9,chrome12等等,所以部分結論可能對這些最新的瀏覽器不成立。如圖是我在ff下的觀測結果 red if html matches i...

pitch yaw roll 最直觀的解釋

pitch 將物體繞x軸旋轉 localrotationx yaw 將物體繞y軸旋轉 localrotationy roll 將物體繞z軸旋轉 localrotationz roll 繞x軸 pitch 繞y軸 yaw 繞z軸 從攝像機roll,yaw,pitch的示意圖中,我們看到並不是說 rol...

史上最牛的面試

1.你為什麼來應聘這份工作。答 以前俺是乙隻迷途的騾子,現在可算找到組織了。2.你是怎麼知道我們招聘這個職位的呢?答 乙個合格的員工除了要有騾子般的身體以外,還必須有獵狗一樣的嗅覺。3.我們為什麼要聘你呢?答 俺吃的少,拉的多。4.你認為自己最大的優點是什麼?答 像騾子一樣吃苦,像工蜂一樣耐勞,像獵...