CSS masking (mask, mask-image, mask-composite) unprefixed
Baseline 2023 (Chrome 120, Safari 15.4, Firefox 53); widely available.
Chrome 120
Edge 120
Safari 15.4
Firefox 53
Unprefixed `mask` lets you fade, cut and shape any element with gradients or images; combined masks (`mask-composite`) produce rings, notches and soft edges without extra DOM.
CSS
.fx-022 {
width: 100%;
max-width: 400px;
display: block;
border-radius: 12px;
mask: linear-gradient(#000 60%,transparent),radial-gradient(circle at 85% 20%,transparent 40px,#000 41px);
mask-composite: intersect
}
HTML
<div class="fx-022" style="aspect-ratio:16/10;background:linear-gradient(135deg,#dbeaff,#ece0ff)"></div>Fallback: Very old WebKit needs `-webkit-mask`; evergreen browsers are fine unprefixed.
Prompt
Use unprefixed `mask` / `mask-image` with gradients for fades and cut-outs (e.g. `mask: linear-gradient(#000 70%, transparent)` for a bottom fade), and `mask-composite: intersect|exclude` to combine layers. Prefer masks over overlay divs and pseudo-elements for fading content edges and scroll-shadow effects.