Conditional CSS for Firefox/Gecko browsers


Last year I posted how to add conditional comments for webkit-based browsers. This time I found a really cool hack on how to do the very same thing for Firefox/Gecko-based browsers (from Chris Coyier). The solution is again very simple and it's based on a media query that only Firefox/Gecko-based browsers will parse.

@-moz-document url-prefix() {
  .selector {
    color: lime;
  }
}
<h1 class="selector">Lime text color in Firefox/Gecko browsers!</h1>