Code Snippet

Home » Code Snippets » CSS » CSS Hacks Targeting Firefox

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;
  }
}

Subscribe to The Thread

  1. 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.

  2. Hey,

    thanks for the tip but its not working in Firefox 3.6.x anymore..

  3. but thius one works!

    .selector, x:-moz-any-link, x:default { color:lime; } /* FireFox 3 */

  4. sistu

    @tom: thanks a lot! works fine for me!

  5. Mohit

    Thanks for the information provided.

    Please let me know about Firefox 4.0 and IE9 CSS hacks….

  6. Its very lovey hack for mozilla.

    it has resolved my mozilla-firefox problem.

    Thanks you
    Vindesh Mohariya

  7. IE 9 hack …

    .selector { color: #fff\9; }

    Firefox 4 hacks anyone?

  8. great hack thank you.

  9. uhmm.. what does it do? hehe sorry i’m a newbie to this. :))

  10. maggie

    Is it possible to use certain classes when FF loads page?

  11. jacvk

    @-moz-document url-prefix() doesnt seem to be working in Firefox 7. Any other ideas?

  12. 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?

  13. I solved it. It was a structure problem …
    Thanks for the hot tip :-)

    • ahmet

      how did you solved it? i’m stuck at it.

    • guest 00

      @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

  14. Great ! thank you.

  15. 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

  16. nice list. thx

Speak, my friend

At this moment, you have an awesome opportunity* to be the person your mother always wanted you to be: kind, helpful, and smart. Do that, and we'll give you a big ol' gold star for the day (literally).

Posting tips:
  • You can use basic HTML
  • When posting code, please turn all
    < characters into &lt;
  • If the code is multi-line, use
    <pre><code></code></pre>
Thank you,
~ The Management ~