0

我正在使用一些 CSS(来自 Joomla 模板),如下所示:

div#logo {
    -moz-background-clip: border;
    -moz-background-inline-policy: continuous;
    -moz-background-origin: padding;
    background: transparent url(../images/head.png) no-repeat scroll 0 0;
    ...
}

我查看了其中一些-moz-属性,它们似乎被分配了默认值,如果我在 Firebug 中将它们关闭,则什么也不会发生。

是否有理由将它们添加到 CSS 文件中?它们可能适用于旧版本的 Firefox 吗?

4

4 回答 4

5

I think what's happened is someone's set a background shortcut rule and then looked at the ‘computed style’ resulting from that shortcut rule in the DOM inspector. They've noticed that setting the style also sets Mozilla's background-clip, -origin and -inline-policy properties, and tried to reproduce these rules without understanding what they're for (namely a detail of Mozilla's CSS implementation, and potentially CSS3 in future).

Certainly changing -moz-background-inline-policy would only have any effect on elements that were display: inline (which div isn't by default), and changing the clip/origin properties around the border would only make any difference if the element actually had a border.

Get rid of them.

于 2010-04-19T16:14:28.333 回答
1

很有可能这些属性不需要存在。我怀疑它们被包括在内是为了确保在不同版本的 Firefox 之间进行一致的渲染。我想答案是,如果您发现在您有兴趣支持的 Firefox 版本中禁用它们没有区别,请将它们删除。

于 2010-04-19T16:09:45.530 回答
0

background-clip当前的 Firefox 构建 AFAIK 不支持,因此作者可能已将它们放在先发制人的问题中(尽管这很奇怪,因为它们都设置为默认值,并且它们没有包含歌剧或 webkit 前缀.. .)

background-inline-policycontinuous在所有 Firefox 中都是默认的,并且在它们中background-origin也是默认的。padding

我会说这个毫无意义的代码。

于 2010-04-19T16:09:01.467 回答
-1

If I turn them off in Firebug nothing happens visibly.

I'm not sure on those particular attributes, but have you checked that the browser isn't using a cached style sheet?

于 2010-04-19T15:59:45.757 回答