CSS Hacks for Different Versions of Firefox

Thứ Tư, 29 tháng 2, 2012
CSS Hacks targeting all Firefox

These hacks target all versions of Firefox:
/* Target all Firefox */
 #selector[id=selector] { color: red; }
 /* Target all Firefox */ 
 @-moz-document url-prefix() { .selector { color: red; } }
 /* Target all Gecko (includes Firefox) */ 
*>.selector { color: red; }

CSS Hacks targeting Firefox 1.5 and newer

This hack targets Firefox versions 1.5 and newer:
/* Target Firefox 1.5 and newer [!] */
 .selector, x:-moz-any-link, x:only-child { color: red; }

CSS Hacks targeting Firefox 2 and older

These hacks target Firefox 2 and older:
/* Target Firefox 2 and older [!] */
 body:empty .selector { color: red; } 
 /* Target Firefox 2 and older */ 
#selector[id=SELECTOR] { color: red; }
 /* Target FireFox 2 and older [!] */ 
html>/**/body .selector, x:-moz-any-link { color: red; }

CSS Hacks targeting Firefox 3

This hack targets Firefox 3 (and possibly newer):
/* Target FireFox 3 [!] */
 html>/**/body .selector, x:-moz-any-link, x:default { color: red; }

Xem thêm bài viết cùng chuyên mục:

Ý kiến bạn đọc [ 0 ]


Ý kiến của bạn