CSS Hack IE6, IE7, IE8, FF

3 九月, 2009 at 5:43 下午 發表留言

always meet the css problem in different version/type of browser, so trouble in development…

below some remarks for the css hack:

I have captured some information from the web but the * cannot run in IE8, not success, so use \9 for all IE

.classname
{
 color: blue\9
}

本文據說的主要是通過“.”,“>”,“*”,“_”来区分。以下是本人對這四種符號的測試結果:
———————IE6—— IE7——IE8——FF2——FF3— Opera9.5
>property—— Y——--- Y—— Y-—— N—— N--—— N
.property—— Y——--- Y—— Y-—— N—— N--—— N
*property—— Y——--- Y—— Y-—— N—— N--—— N
_property—— Y——--- N—— N-—— N—— N--—— N

因此這就實現了跨流覽器的表現問題。_property和*property也是一樣的。對於_property來說,只有IE6才能識別,因此可以用於單獨對IE6的設置中。

不過這裡要注意書寫的順序:現在流覽器的寫法要寫在最前面,IE6的寫法要寫在最後面用於覆蓋,其他流覽器寫在中間。
 

方法二:
其實主要是流覽器:IE6/IE7/firefox下,各個對CSS代碼的解釋有區別,下邊轉載一篇HACK的文章,相當實用。

區別IE6FF: background:orange;*background:blue;

區別IE6IE7: background:green!important;background:blue;

區別IE7與FF: background:orange; *background:green;

區別FF/IE7/IE6: background:orange;*background:green!important;*background:blue;

注:IE都能識別*標準流覽器(如FF)不能識別*
IE6能識別*,但不能識別 !important
IE7能識別*,也能識別!important
FF不能識別*,但能識別!important

另外再補充一個,底線"_“,
IE6支援底線,IE7和firefox均不支援底線。

Entry filed under: HTML. Tags: , , , , , , .

Restore Indentity/auto number to 1 jquery 1.3.2 and IntelliSense

發表留言

Trackback this post  |  Subscribe to the comments via RSS Feed