CSS Mask Generator
Generate CSS mask-image gradients for fades and reveals.
Fade and reveal with CSS masks
mask-image lets you fade an element out at its edges, reveal it through a shape, or apply a gradient cutout — effects that would otherwise need extra images. This generator builds gradient mask CSS with a live preview of the result.
Masks are underused because the syntax is unfamiliar, but they are perfect for soft image fades and scroll edges. Adjust the gradient and copy the mask CSS (including the -webkit- prefix) to apply the effect to any element.
Copy-ready mask CSS
mask-image with a gradient fades an element at its edges, and the output includes the -webkit- prefix for Safari. Built in your browser.
Frequently asked questions
What does the fade stop control?
Where the gradient starts fading. At 65%, the element is fully visible for the first 65% in the chosen direction, then fades to transparent by the end.
Why does the output include -webkit-mask-image?
Older Chromium and Safari versions only supported the prefixed property. Current browsers support mask-image unprefixed, so the pair covers both.
Which color should the mask gradient use?
Only the alpha channel matters for masks. Opaque black keeps the content visible and transparent hides it, so #000 to transparent is the standard pattern.
Related tools
Practical utilities for front-end design and implementation work.