非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。

-webkit-mask-composite property specifies the manner in which multiple mask images applied to the same element are composited with one another. Mask images are composited in the opposite order that they are declared with the -webkit-mask-image 特性。

/* Keyword values */
-webkit-mask-composite: clear;
-webkit-mask-composite: copy;
-webkit-mask-composite: source-over;
-webkit-mask-composite: source-in;
-webkit-mask-composite: source-out;
-webkit-mask-composite: source-atop;
-webkit-mask-composite: destination-over;
-webkit-mask-composite: destination-in;
-webkit-mask-composite: destination-out;
-webkit-mask-composite: destination-atop;
-webkit-mask-composite: xor;
/* Global values */
-webkit-mask-composite: inherit;
-webkit-mask-composite: initial;
-webkit-mask-composite: unset;
					

There is a standardized mask-composite property covering parts of this non-standard property using different keywords.

句法

clear

Overlapping pixels in the source mask image and the destination mask image are cleared.

copy

The source mask image replaces the destination mask image.

source-over

The source mask image is rendered over the destination mask image.

source-in

Overlapping pixels in the source mask image and the destination mask image are replaced by the pixels of the source mask image; all other pixels are cleared.

source-out

Overlapping pixels in the source mask image and the destination mask image are cleared; all remaining pixels of the source mask image are rendered.

source-atop

The pixels of the destination mask image are rendered. The pixels of the source mask image are rendered only if they overlap a nontransparent portion of the destination mask image. This causes the source mask image to have no effect.

destination-over

The destination mask image is rendered over the source mask image.

destination-in

Overlapping pixels in the source mask image and the destination mask image remain the pixels of the destination mask image; all other pixels are cleared.

destination-out

Overlapping pixels in the source mask image and the destination mask image are cleared; all remaining pixels of the source mask image are rendered.

destination-atop

The pixels of the source mask image are rendered. The pixels of the destination mask image are rendered only if they overlap a nontransparent portion of the destination mask image. This causes the destination mask image to have no effect.

xor

Overlapping pixels in the source mask image and the destination mask image become fully transparent if they are both fully opaque.

形式定义

初始值 source-over
适用于 所有元素
继承 no
计算值 如指定
动画类型 discrete

形式句法

<composite-style>#

where
<composite-style> = clear | copy | source-over | source-in | source-out | source-atop | destination-over | destination-in | destination-out | destination-atop | xor

范例

Compositing with XOR

.example {
  -webkit-mask-image: url(mask1.png), url('mask2.png');
  -webkit-mask-composite: xor, source-over;
}
					

规范

Not part of any standard. This property is specified as mask-composite using different values.

浏览器兼容性

The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
-webkit-mask-composite 非标 Chrome 完整支持 1 Edge 完整支持 18 Firefox 完整支持 53 IE 不支持 No Opera 完整支持 15 Safari 完整支持 3.2 WebView Android 完整支持 2 Chrome Android 完整支持 18 Firefox Android 完整支持 53 Opera Android 完整支持 14 Safari iOS 完整支持 3.2 Samsung Internet Android 完整支持 1.0

图例

完整支持

完整支持

不支持

不支持

非标。预期跨浏览器支持较差。

非标。预期跨浏览器支持较差。

另请参阅

元数据

  • 最后修改: