这些 Mozilla 特定的 CSS 样式有什么作用吗?

发布于 2024-08-29 13:56:56 字数 408 浏览 5 评论 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?

I'm working with some CSS (from a Joomla template) like this:

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;
    ...
}

I've looked up some of those -moz- properties and they seem to be assigned their default values, and if I turn them off in Firebug nothing happens visibly.

Would there be a reason to add them to a CSS file? Are they for an old version of Firefox perhaps?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

下壹個目標 2024-09-05 13:56:56

我认为发生的事情是有人设置了一个 background 快捷方式规则,然后在 DOM 检查器中查看该快捷方式规则产生的“计算样式”。他们注意到,设置样式也会设置 Mozilla 的 background-clip-origin-inline-policy 属性,并尝试重现这些规则而不了解它们的用途(即 Mozilla CSS 实现的细节,以及未来可能的 CSS3)。

当然,更改 -moz-background-inline-policy 只会对 display: inline 的元素产生任何影响(其中 div 不是由默认),并且仅当元素实际上有边框时,更改边框周围的 clip/origin 属性才会产生任何影响。

摆脱他们。

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.

被你宠の有点坏 2024-09-05 13:56:56

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

Chances are good that these properties don't need to be there. I'd suspect that they're included to ensure consistent rendering across different versions of Firefox. I guess the answer is, if you're seeing no difference from disabling them in the versions of Firefox you're interested in supporting, take them out.

自我难过 2024-09-05 13:56:56

AFAIK 当前的 Firefox 版本不支持 background-clip ,因此作者可能已经将它们放在了先发制人的问题中(尽管这很奇怪,因为无论如何它们都设置为默认值,而且它们还没有不包括 opera 或 webkit 前缀...)

background-inline-policy 在所有 Firefox 中默认为 Continue,而 background-origin它们也默认为 padding

我想说这个代码毫无意义。

background-clip isn't supported on current Firefox builds AFAIK, so the author has probably put them in preempting a problem (though that would be odd as they are all set to the default anyway, and they haven't included the opera or webkit prefixes...)

background-inline-policy is default as continuous in all Firefoxes, and background-origin is default as padding in them all too.

I'd say pointless code for this one.

感情洁癖 2024-09-05 13:56:56

如果我在 Firebug 中关闭它们,则不会发生任何明显的变化。

我不确定这些特定的属性,但是您是否检查过浏览器没有使用缓存的样式表?

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文