mask

A shorthand property that allows you to hide or partially hide parts of an element using an image or a gradient. It's like using a stencil to cut a shape out of an element.

It is documented as part of the CSS Masking specification.

/* Usage Example */
.masked-image {
  mask: linear-gradient(black, transparent);
  /* fades the image out from top to bottom */
}

/* Global values */
mask: inherit;
mask: initial;
mask: revert;
mask: revert-layer;
mask: unset;
Newly available Since 2023 88% global usage

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

120+
53+
15.4+
120+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC