Code Snippet
CSS Hacks Targeting Firefox
Firefox 2
html>/**/body .selector, x:-moz-any-link {
color:lime;
}
Firefox 3
html>/**/body .selector, x:-moz-any-link, x:default {
color:lime;
}
Any Firefox
@-moz-document url-prefix() {
.selector {
color:lime;
}
}
Mayb I can test or guess it, but what does it do?
It targets only Firefox browsers, so you can make CSS exceptions. You would use it for hacks, to make your site more functional. (If required).
Most hacks are for I.E., since they can render a lot differently than other browsers.
Hey,
thanks for the tip but its not working in Firefox 3.6.x anymore..
but thius one works!
.selector, x:-moz-any-link, x:default { color:lime; } /* FireFox 3 */@tom: thanks a lot! works fine for me!
Thanks for the information provided.
Please let me know about Firefox 4.0 and IE9 CSS hacks….
Its very lovey hack for mozilla.
it has resolved my mozilla-firefox problem.
Thanks you
Vindesh Mohariya
IE 9 hack …
.selector { color: #fff\9; }
Firefox 4 hacks anyone?
“\9″ works for both ie8 and ie9.
\9 works for all the IEs
It works to my website also thanks for sharing
great hack thank you.
uhmm.. what does it do? hehe sorry i’m a newbie to this. :))
Is it possible to use certain classes when FF loads page?
@-moz-document url-prefix() doesnt seem to be working in Firefox 7. Any other ideas?
Mmhhh, if I use the any FF hack with a a:hover or so. It dosen’t work …
@-moz-document url-prefix() {
a:focus {padding-bottom: 7px;}
}
Has anyone help for that?
I solved it. It was a structure problem …
Thanks for the hot tip :-)
how did you solved it? i’m stuck at it.
@ahmet,
people won’t reply once their problem is fix, mee is just one of those kind. i’m actually looking for the solution too.
Cheers
Great ! thank you.
do you know how to target FF9 only? I am actually having an issue of CSS rendering differently on Mac and PC using the same version of FF. Never had this problems in the past. Thank you
nice list. thx
Awesome and timely. Thanks for the hack help!
Hey Chris,
Never really had the change to thank you, yours is the first site I go to when I need to learn or find something out on CSS. Your site is invaluable to us web devs. I’ve really learned a lot from your site, keep it up.
Thanks
This doesn’t appear to be valid
@-moz-document url-prefix() {
#divhere {
color: red;
}
}
The CSS seems to be getting confused with the wrapping brackets which causes it to be invalid, any thoughts?
Looks like it works now, though only if I add !important at the end of the value…. weird. Also of note i am using a scss sheet
Looks great,
Thanks you so much .
it’s working fine.
DigWP
A book and blog co-authored by Jeff Starr and myself about the World's most popular publishing platform.
Quotes on Design
Design, like Art, can be an elusive word to define and an awfully fun thing to have opinions about.
HTML-Ipsum
One-click copy to clipboard access to Lorem Ipsum text that comes wrapped in a variety of HTML.
Bookshelf
Hey Chris, what books do you recommend? These, young fertile mind, these.