mask
Widely availableSince 202397% of users
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.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyModernIn every major browser since December 2023. Widely available since June 2026.
See how modern your own CSS is.Check your CSS →
Quick facts
- Initial value
See individual properties- Inherited
- No
- Applies to
- all elements and SVG container elements
Quick example
.masked-image {
mask: linear-gradient(black, transparent);
/* fades the image out from top to bottom */
}mask browser support
BaselineWidely availableThis feature is well established and works across many devices and browser versions. It has been available across browsers since 2023.Safe to use without fallbacks.
Usage97%of people can use this3% use a browser without it.
Browsers
120+
53+
15.4+
120+Mobile
120+Android
53+Android
15.4+iOS