gpt4 book ai didi

css - 为什么 Firebug 在检查元素 CSS 时添加 -moz-* 样式?

转载 作者:技术小花猫 更新时间:2023-10-29 11:07:12 24 4
gpt4 key购买 nike

每当我在 Firebug 中检查页面元素时,我总是看到它添加了样式,例如...

-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;

...等,到样式框。为什么要这样做?

最佳答案

添加这些规则的不是 Firebug,而是 Gecko 渲染引擎。它们是“默认样式表”的一部分。 (特定代理在解析页面上的样式之前应用的默认样式。它们具有 0,0,0,0 的特异性,这实际上意味着同一规则的任何进一步声明都会覆盖默认值。)

由于您在 Firebug 设置中选中了“Show User-Agent CSS”,因此 Firebug 会显示这些规则。


来自 Mozilla 开发人员引用:

-moz-background-clip

In Gecko-based applications like Firefox the -moz-background-clip CSS property specifies whether an element's background, either the color or image, extends underneath its border

border: (initial) The background extends to the outside edge of the border (but underneath the border in z-ordering).

padding: No background is drawn below the border (background extends to the outside edge of the padding).


-moz-background-inline-policy

In Gecko-based applications like Firefox, the -moz-background-inline-policy CSS property specifies how the background image of an inline element is determined when the content of the inline element wraps onto multiple lines. The choice of position has significant effects on repetition.

bounding-box: The background image is positioned (and repeated) in the smallest rectangle that contains all of the inline boxes for the element. It is then clipped to be visible only within those boxes, according to the -moz-background-clip property.

continuous: (Initial) The background image is positioned (and repeated) as if the inline box were not broken across lines, and then this long rectangle is sliced into pieces for each line.

each-box: The background image is positioned (and repeated) separately for each box of the inline element. This means that an image with background-repeat : no-repeat may be repeated multiple times.


-moz-background-origin

In Mozilla applications like Firefox, the -moz-background-origin CSS property determines the background positioning area (the origin of a background-image).

border: The background position is relative to the border, so the image can go behind the border.

padding: (Initial) The background position is relative to the padding.

content: The background position is relative to the content.

关于css - 为什么 Firebug 在检查元素 CSS 时添加 -moz-* 样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1257118/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com