Skip to content

Instantly share code, notes, and snippets.

@dr-dimitru
Last active December 26, 2015 15:19
Show Gist options
  • Save dr-dimitru/7171531 to your computer and use it in GitHub Desktop.
Save dr-dimitru/7171531 to your computer and use it in GitHub Desktop.
CSS browser specific targets selector, rules, statements and pseudo-classes

Opera:

Docs for > Opera 9.5

doesnotexist:-o-prefocus, .example {
    /*The following will apply rules to 'example' class in Opera only.*/
}

Firefox:

Docs document (at-rule)

  • url(), which matches an exact URL
  • url-prefix(), which matches if the document URL starts with the value provided
  • domain(), which matches if the document URL is on the domain provided (or a subdomain of it)
  • regexp(), which matches if the document URL is matched by the regular expression provided. The expression must match the entire URL.
    @-moz-document url-prefix() {
        
      .selector{
        /*Rules applyed to 'selector' class only in Firefox*/
      }
    }

The @document rule is an at-rule that restricts the style rules contained within it based on the URL of the document. It is designed primarily for user style sheets. A @document rule can specify one or more matching functions. If any of the functions apply to a URL, the rule will take effect on that URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment