CSS Hacks Targeting Firefox

Firefox specific styling is now possible with CSS alone. No more JS hacks required.

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

Thank you so much Nidhin for giving us such an effective Mozilla specific info.

Recent Article

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  1. Nidhin Mohan at 11:18 am

    There are some hacks for Opera as well :-).

    noindex:-o-prefocus, .selector{

    Your syling here;


    For Safari. You need the extra brackets to wrap your selector and rules in the hack for webkit. I’ve noticed as I type this up it’s putting the second set of brackets on the same line. Those two brackets on the bottom need to be on a seperate line.

    @media all and (-webkit-min-device-pixel-ratio:0){

    Your syling here;

  2. Nidhin Mohan at 11:09 am

    Folks!!!! There are some simple css hacks for ie-8 and ie-9.

    IE8, IE 9 hack …

    .selector { Yoyr syle here\9; }

        • Joel Philip at 11:29 am

          As usual cool hacks from CSS side. Keep it up man. You could rid a lot of JS code with this stuff. Please continue posting. I would also recommend that you keep a spellcheck. Thanks a lot. 🙂

  3. Joel Philip at 10:58 am

    Thanks Anish & Nidhin for this stuff. Very useful. No more JS hacks needed. Everything CSS 🙂

  • Keep your skills sharp, get informed.

    Subscribe to our mailing list and get interesting stuff and updates to your email inbox