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

前端之家收集整理的这篇文章主要介绍了为什么Firebug在检查元素CSS时会添加-moz- *样式?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
每当我检查Firebug中的页面元素时,我总是看到它添加样式,如…
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;

……等样式框.为什么这样做?

解决方法

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

由于您在Firebug设置中选中了“显示用户代理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相关文章