为什么Firebug在检查元素CSS时添加-moz- *样式? [英] Why does Firebug add -moz-* styles when inspecting element CSS?

查看:172
本文介绍了为什么Firebug在检查元素CSS时添加-moz- *样式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

...等。为什么要这样做?

解决方案

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



由于您在Firebug设置中选中了显示用户代理CSS,Firebug会显示这些规则。






从Mozilla开发人员参考资料:



- moz-background-clip




在基于Gecko的应用程序 -moz-background-clip CSS属性指定元素的背景(颜色或图像)是否在其边框下延伸



border :(初始)背景延伸到边框的外边缘(但在z顺序中位于边框下方)。



padding :在边框下方没有绘制背景(背景延伸到边框的外边缘)。







- moz-background-inline-policy




在基于Gecko的应用程序(如Firefox)中, -moz-background-inline-policy CSS属性指定如何确定内联元素的背景图像,内联元素将换行到多个行。

边界框:背景图片在最小矩形中定位(并重复)包含元素的所有内联框。然后根据 -moz-background-clip 属性,将其剪裁为仅在这些框中可见。



连续:(初始)背景图像被定位(并重复),就好像行内框没有在行之间折断,

每个框:对于每一行,背景图像被分别定位(并重复)内联元素。这意味着 background-repeat:no-repeat 的图片可能会重复多次。







- moz-background-origin




Mozilla应用程序(如Firefox), -moz-background-origin CSS属性决定了背景定位区域(背景图像的原点)。



border :背景位置是相对于边框的,因此图片可以在边框后面。



strong> padding :(初始)背景位置是相对于填充。



content 内容。



Whenever I inspect page elements in Firebug, I always see it adding styles such as...

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

... etc, to the Style box. Why does it do this?

解决方案

It isn't Firebug adding those rules but the Gecko rendering engine. They are part of "the default stylesheet". (The default style a particular agent applies before parsing the styles on the page. They have a specificity of 0,0,0,0 which essentially means that any further declaration of the same rule overrides the default.)

Since you have "Show User-Agent CSS" Checked in your Firebug settings, Firebug displays those rules.


From the Mozilla Developer Reference:

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

这篇关于为什么Firebug在检查元素CSS时添加-moz- *样式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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