> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# mask-composite

APISummary
## 介绍

`mask-composite` CSS 属性设置当前遮罩层与其下方遮罩层之间使用的合成操作。

## 语法

```css
mask-image: linear-gradient(#000, #000), linear-gradient(#000, transparent);
mask-composite: exclude;
```

### 取值

- `add`<br />
  将当前遮罩层叠加到其下方遮罩层之上。

- `subtract`<br />
  从下方遮罩层中减去当前遮罩层。

- `intersect`<br />
  保留下方遮罩层与当前遮罩层的重叠区域。

- `exclude`<br />
  保留下方遮罩层与当前遮罩层不重叠的区域。

## 形式定义


| 初始值 | add |
| 适用元素 | `view` only |
| 是否支持继承 | no |
| 是否支持动画 | no |


## 形式语法

```
mask-composite = <compositing-operator>#

<compositing-operator> =
  add        |
  subtract   |
  intersect  |
  exclude
```

## 与 Web 的区别

- 不支持全局属性值，例如 `inherit`、`initial`、`unset` 等。

## 兼容性


**Compatibility Table**
**Query:** `css.properties.mask-composite`

**MDN Reference:** [https://developer.mozilla.org/zh-CN/docs/Web/CSS/mask-composite](https://developer.mozilla.org/zh-CN/docs/Web/CSS/mask-composite)

**Specifications:**
- [https://drafts.fxtf.org/css-masking-1/#the-mask-composite](https://drafts.fxtf.org/css-masking-1/#the-mask-composite)

**Platform Support**

| Platform | Version Added | Notes |
|----------|---------------|-------|
| Android | ❌ No | - |
| iOS | ❌ No | - |
| HarmonyOS | ❌ No | - |
| Clay Android | ❌ No | - |
| Clay macOS | 4.0 | - |
| Clay Windows | 4.0 | - |
| Web | ✅ Yes | - |

**Description:** The mask-composite CSS property represents a compositing operation used on the current mask layer with the mask layers below it.

