@ -moz-document url-prefix()是什么? [英] What does @-moz-document url-prefix() do?

查看:3074
本文介绍了@ -moz-document url-prefix()是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Simon Collison的新的响应式网页设计中,在CSS中,有几个声明如下:

In Simon Collison's new Responsive Web Design, in the CSS, there are several declarations 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; }
}

这实际上是做什么的?我已经搜索@ -moz-document url-prefix(),并找到了在userchrome而不是标准网站样式表中使用的参考。

What does this actually do? I've googled for @-moz-document url-prefix() and have found references for its use within userchrome but not standard site stylesheets.

它通常具有作为参数传入的网址,然后将声明的内容限制为该网址。但是,在Colly的网站上,没有传入参数。这表明声明操作的是当前网址或任何网址,没有?

It usually has a URL passed in as an argument which then restricts the content of the declaration to that URL. However, on Colly's site, there is no argument being passed in. This would indicate that the declaration is operating on the current URL, or any URL, no? So is what we're seeing here a way of targeting Mozilla-only browsers with certain rules?

推荐答案

p>以 @ - moz - 开头的任何CSS规则是Gecko引擎特定的规则,而不是标准规则。

Any CSS at-rule that starts with @-moz- is a Gecko-engine-specific rule, not a standard rule. That is, it is a Mozilla-specific extension.

url-prefix 规则将包含的样式规则应用于任何网址以网址开头的网页。当没有像 @ - moz-document url-prefix()这样的URL参数时,它适用于所有页面。这实际上是一个仅用于定位Gecko(Mozilla Firefox)的 CSS hack

The url-prefix rule applies the contained style rules to any page whose URL starts with it. When used with no URL argument like @-moz-document url-prefix() it applies to ALL pages. That's effectively a CSS hack used to only target Gecko (Mozilla Firefox). All other browsers will ignore the styles.

请参阅此处查看其他Mozilla特定扩展程序的列表。

See here for a list of other Mozilla-specific extensions.

这篇关于@ -moz-document url-prefix()是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆