A Web Design Community curated by Chris Coyier

A little dab'll do ya

Code Snippets

Home » Code Snippets » CSS » CSS Hacks Targeting Firefox Submit one!

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. Robin says:

    Mayb I can test or guess it, but what does it do?

    • Andrew Champ says:

      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. Tom says:

    Hey,

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

  3. Tom says:

    but thius one works!

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

  4. sistu says:

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

  5. Mohit says:

    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. @3kolone says:

    IE 9 hack …

    .selector { color: #fff\9; }

    Firefox 4 hacks anyone?

It's Your Turn

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