Visit Mozilla.org

CSS:@-moz-document

From MDC

« CSS « CSS Reference « CSS Reference:Mozilla Extensions

[edit] Summary

The @-moz-document rule is a Gecko-specific 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.

[edit] Syntax

[edit] Examples

You can put this into your userContent.css file:

@-moz-document url(http://www.w3.org/),
               url-prefix(http://www.w3.org/Style/),
               domain(mozilla.org)
{
  /* CSS rules here apply to:
     + The page "http://www.w3.org/".
     + Any page whose URL begins with "http://www.w3.org/Style/"
     + Any page whose URL's host is "mozilla.org" or ends with
       ".mozilla.org"
   */

  /* make the above-mentioned pages really ugly */
  body { color: purple; background: yellow; }
}

[edit] Specifications

[edit] Browser compatibility

Available since Mozilla 1.8 / Firefox 1.5.