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-image CSS property sets the image that is used as mask layer for an element. By default this means the alpha channel of the mask image will be multiplied with the alpha channel of the element. This can be controlled with the mask-mode property.


/* Keyword value */
mask-image: none;

/* <mask-source> value */
mask-image: url(masks.svg#mask1);

/* <image> values */
mask-image: linear-gradient(rgb(0 0 0 / 100%), transparent);
mask-image: image(url(mask.png), skyblue);

/* Multiple values */
mask-image: image(url(mask.png), skyblue),
  linear-gradient(rgb(0 0 0 / 100%), transparent);

/* Global values */
mask-image: inherit;
mask-image: initial;
mask-image: revert;
mask-image: revert-layer;
mask-image: unset;



This keyword is interpreted as an opaque white image layer.


A url() reference to a <mask> or to a CSS image.


An image value used as mask image layer.

Formal definition

Initial valuenone
Applies toall elements; In SVG, it applies to container elements excluding the <defs> element and all graphics elements
Computed valueas specified, but with url() values made absolute
Animation typediscrete

Formal syntax

mask-image = 

<mask-reference> =
none |
<image> |

<image> =
<url> |

<mask-source> =

<url> =
<url()> |

<url()> =
url( <string> <url-modifier>* ) |

<src()> =
src( <string> <url-modifier>* )


Setting a mask image with a URL


CSS Masking Module Level 1
# the-mask-image

Browser compatibility

BCD tables only load in the browser

See also