property
mask-type — CSS reference
Sets preferred coverage mode of an SVG mask element. Initial luminance; not inherited. Black opaque pixels hide in luminance mode and reveal in alpha mode. A referencing mask-mode can override it.
Formal Syntax & Structure
css syntaxcss
luminance | alphaWorking Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS masking and shapes lab</title><style>body {margin:0} .sample {background:#dcebe9;color:#182e32}body{background:white} #a{position:relative;margin:20px;width:80px;height:60px;background:red;box-sizing:content-box}#m{mask-type:alpha} #a{mask-image:url(#m)}</style><body><svg width="0" height="0" style="position:absolute" aria-hidden="true"><defs><mask id="m" maskContentUnits="objectBoundingBox"><rect width="1" height="1" fill="black"/></mask></defs></svg><div id="a" aria-hidden="true"></div></body></html>