What does @ -moz-document url-prefix () do?

Simon Collison has a new responsive web design , there are several declarations in CSS like this:

@-moz-document url-prefix() { .fl { float:left; margin:12px 4px 0 0; padding:0; font-size:65px; line-height:62%; color:#ba1820; } .fs { float:left; margin:12px 4px 10px 0; padding:0; font-size:65px; line-height:62%; color:#ba1820; } } 

What is this actually doing? I googled for @ -moz-document url-prefix () and found links for using it in userchrome, but not in standard site style sheets.

It usually has a URL passed as an argument, which then restricts the contents of the advertisement to that URL. However, the Colly site does not pass an argument. Does this mean the ad is running at the current URL or any URL, no? So, - this is what we see here, how to orient browsers only for Mozilla with certain rules ?

+77
css
Jun 26 '10 at 7:28
source share
3 answers

Any CSS rule starting with @-moz- is a Gecko-engine rule, not a standard rule. That is, this extension is dependent on Mozilla.

The url-prefix rule applies the contained style rules to any page whose URL begins with it. When using a URL without an argument, for example @-moz-document url-prefix() , this applies to all pages. This is an effective CSS hack , used only for Gecko (Mozilla Firefox). All other browsers will ignore the styles.

See here for a list of other Mozilla related extensions.

+89
Jun 26 '10 at 7:32
source share

From https://developer.mozilla.org/en/CSS/@-moz-document

  @-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 host is "mozilla.org" or ends with ".mozilla.org" */ /* make the above-mentioned pages really ugly */ body { color: purple; background: yellow; } } 
+17
Jun 26 2018-10-06T00:
source share

Starting with Firefox 59 you should just use:

@document url("https://www.example.com/")

Support for the -moz-prefixed version of this property has been stopped for web content due to an error:

https://bugzilla.mozilla.org/show_bug.cgi?id=1035091

+1
Jan 23 '18 at 10:02
source share



All Articles