mask

Baseline 2023
Newly available

Since ⁨December 2023⁩, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

The mask attribute is a presentation attribute mainly used to bind a given <mask> element with the element the attribute belongs to.

Note: As a presentation attribute, mask also has a CSS property counterpart: mask. When both are specified, the CSS property takes priority.

You can use this attribute with the following SVG elements:

Example

Since SVG2, the mask attribute is defined as a CSS property and is a shorthand for many other properties: mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-size, and mask-composite.

Usage notes

Value See the CSS property mask
Default value none
Animatable Yes

Specifications

Specification
CSS Masking Module Level 1
# the-mask

Browser compatibility

See also